Wanting to return a simple YES or NO result in Excel based on data input. We have had troubles programming this, and just cannot seem to get an answer on how to properly write the IF statement within the cell.
In basic terms, here is our question (not in Excel format but spelled out)...
IF D11="Short" AND G11>0.00 then Yes, otherwise No OR IF d11="Long" AND G11<0.00 then Yes, otherwise No.
We cannot seem to get the syntax working properly. Any suggestions on how to accomplish this task?
UPDATE: The proper process seems to be to use... =IF(OR(AND(D11="Short",G11>0),AND(D11="Long",G11<0)), "YES", "NO")
This in fact solves the issue for those fields that are populated. However, is there a way that to still use this formula, but if d11 is blank to return a blank?
AND
, OR
and IF
are all functions not just statements. You have 2 sets of conditions which are valid so put the AND
s inside the OR
:
=IF(OR(AND(D11 = "Short", G11 > 0), AND(D11 = "Long", G11 < 0)), "YES", "NO")