=IF(OR question

J

Jock

Hi,
Having a problem here. Essentially: In cell B9
=IF(either B6 OR B7=0,"",If(B6<B7,"",B6-B7)
Can someone sort this one out for me?

Thanks
 
N

Noob Jedi

Hi,
Having a problem here. Essentially: In cell B9
=IF(either B6 OR B7=0,"",If(B6<B7,"",B6-B7)
Can someone sort this one out for me?

Thanks

=IF(OR(B6=0,B7=0),"",IF(B6<B7,"",B6-B7))
 
P

Peo Sjoblom

=IF(OR(B6=0,B7=0,B6<B7),"",B6-B7)

however do you want zero if B6=B7, if not change the formula to

=IF(OR(B6=0,B7=0,B6<=B7),"",B6-B7)
 
J

Jock

Thanks to all. To take it one more step; if there was a range of cells (ie
B6:B18), rather than the two (B6 & B7) that need to be any value other than
0, how would the formula be modified?
 
J

JE McGimpsey

Hard to modify your formula: what would would you be subtracting from
what in that case?

Perhaps you can modify:

=IF(COUNTIF(B6:B18,0)=0,<some formula>,"")
 
P

Peo Sjoblom

=IF(COUNTIF(B6:B18,0)>0,"", and so on

depending on what you want, the above test if any of those cells are zero
 
J

Jock

Hi JE,
it was only hypothetical. I was curious to see if it was possible to use a
range of cells with the OR function because putting OR(B6=0,B7=0,B8=0,B9=0)
etc is a bit messy.
 
Top