PDA

View Full Version : OT: Help with Excel code thread XXII


Rizon
07-01-2004, 03:56 PM
Here is my formula:

=IF(F6=0,0,IF(F6>0.001,F6,IF(F6="N/A",IF(B17>7000,7000,B17))))

Whereas:
F6= N/A
B17= 1160.25

Basically, I want Excel to:

First look and see if the cell = 0. If it does, enter 0. If it doesn't:
Then look and see if the cell is > 0.001. If it does, enter the contents of the cell, if it doesnt:
Then look to see if the cell = N/A. If it does, then I want it to compute that if the cell in B17 is greater than 7000, to enter 7000. If it doesn't = 7000, then I want it to enter the contents of B17.

Somewhere I'm missing something, because the answer should be 1160.25, but Excel is giving me the answer of "N/A". I wonder if it's because I have 4 "trues" for my IFs, and only three "falses".

Any help would be nice.

Buzzbee
07-01-2004, 04:15 PM
Maybe this?

=IF(F6=0,0,IF(F6>0.001,F6,IF(F6="N/A",IF(B17>7000,7000,B17),IF(B17>7000,7000,B17))))

moriarty
07-01-2004, 04:18 PM
The problem with =IF(F6=0,0,IF(F6>0.001,F6,IF(F6="N/A",IF(B17>7000,7000,B17)))) is that it evaluates N/A as > .001. Put the F6="N/A" check first.

Assuming the value in f6 can't be less than 0, you could get away with:
=IF(F6=0,0,IF(F6="N/A",(IF(B17>7000,7000,B17)),F6))

Rizon
07-01-2004, 04:25 PM
Bingo, thanks Mor.

Correct code:
=IF(F6="N/A",IF(B17>7000,7000,B17),IF(F6=0,0,IF(F6>0.001,F6)))

I actually had tried that earlier, but I must have put the parenthisis in the wrong place. (Although I didn't think it considered N/A to be greater than 0.01)

Thanks again. I'd post girl pictures as a reward, but I'm not allowed.