Bill Golden
asked on
Compound IF statement in Excel
I need to test the existence of an X in various cells in another worksheet.
If 'Balance Sheet'!P221 contains an X, then return the value of 'Balance Sheet!B288 + 1, but if P221 is blank...
If 'Balance Sheet'!P148 contains an X, then return the value of 'Balance Sheet!B215 + 1, but if P148 is blank...
If 'Balance Sheet'!P75 contains an X, then return the value of 'Balance Sheet!B142 + 1, but if P75 is blank...
If 'Balance Sheet'!P2 contains an X, then return the value of 'Balance Sheet!B69 + 1, but if P2 is blank...
return the value of Setup!D53
If 'Balance Sheet'!P221 contains an X, then return the value of 'Balance Sheet!B288 + 1, but if P221 is blank...
If 'Balance Sheet'!P148 contains an X, then return the value of 'Balance Sheet!B215 + 1, but if P148 is blank...
If 'Balance Sheet'!P75 contains an X, then return the value of 'Balance Sheet!B142 + 1, but if P75 is blank...
If 'Balance Sheet'!P2 contains an X, then return the value of 'Balance Sheet!B69 + 1, but if P2 is blank...
return the value of Setup!D53
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That got the job done. There was a " ' " or two missing after the Balance Sheet reference but the previous answer allowed me to spot the problem. Thanks.
Bill
Bill
Open in new window
A couple of clarifications: are you looking to nest all of your statements above, i.e. the second case applies if P221 is blank and so on for the other cases?
Does the contains check need to be case sensitive? SEARCH, which I have used above is not case sensitive. You can use FIND as a direct replacement if the check does need to be case sensitive.