IF formula help

Closed
BasilBloo Posts 4 Registration date Wednesday November 23, 2011 Status Member Last seen November 28, 2011 - Nov 28, 2011 at 11:38 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Nov 30, 2011 at 04:43 PM
Hello,

I am trying to create a spreadsheet using Excel 2010. All the data works fine... Except for this one formula.

When entered into seperate cells in diffirent columns the formulae works, but as soon as I combine them, the last two statements fail...
I must be cancelling one statement with another - please help!

=IF(H5>0,H5*Q5,IF(OR(H5>0,O5>0,),O5*Q5,IF(E5="A",G5*Q5,IF(OR(H5="",J5>0),O5*Q5,IF(OR(J5="",M5>0),M5*Q5,IF(E5="B",P5*Q5,""))))))

Thank you!

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Nov 30, 2011 at 04:43 PM
Your sequence of "IF" logic seems to be a bit shaky. You have
=
IF(H5>0,H5*Q5,
IF(OR(H5>0,O5>0,),O5*Q5,
IF(E5="A",G5*Q5,
IF(OR(H5="",J5>0),O5*Q5,
IF(OR(J5="",M5>0),M5*Q5,
IF(E5="B",P5*Q5,""))))))

Now if you look, at your first two if, in the 2nd if (H5>0) will never be the true due to H5>0 part, because if that ever is the occurrence, then the first IF will be executed
1