Three separate formulas and output value:
=IF(D7&E7="",C8) =IF((AND(C8&D8<>"", E8="")),D8)
=IF(D7&E7="",C8)
=IF((AND(C8&D8<>"", E8="")),D8)