wrosie said:
I'd like to combine three conditional statements into one statement.
The three conditionals:
=IF(E2>0,H2-E2,"")
=IF(F2>0,"","")
=IF(AND(E2=0,F2=0),H2-D2,"")
Is this possible?
Certainly. But first, you need to specify exactly
what you want in English or in unambiguous logical
terms. The above is not 100% clear. My guess is
you mean: if E2>0 (regardless of F2), then H2-E2;
else (E2<=0, so ...) if E2=0 and F2=0, then H2-D2;
else (E2<=0 and F2<>0), so ...) blank (""). That
can be written:
=IF(E2>0,H2-E2,IF(AND(E2=0,F2=0),H2-D2,""))
FYI, your second IF() expression (F2>0) is nonsense.
It says return blank ("") regardless of the value of F2.
I doubt that is what you intended, based on your third
IF() expression. That led me to my interpretation
above.