Nested IF with OR Function

T

Trudy

How do I accomplish this:
If a cell value >0 OR another cell value >0, then leave blank. If either
contains a value, then calculate.
 
T

Trudy

Here is what I tried:

=IF(OR(C6>0,D6>0),"",E5+C6+D6)

But the result is the opposite of what I need. E5+C6+D6 is calculating with
nothing in C6 or D6. I don't want it to calculate if either C6 or D6 are
empty.

Thank you, Roger.
 
R

Roger Govier

Hi Trudy

There must be something in C or D6.
Try
=IF(OR(ISNUMBER(C6),ISNUMBER(D6)),"",E5+C6+D6)

Regards

Roger Govier
 
T

Trudy

Thanks, Roger - I figured out the problem. I had the "thens" switched.

The below is what works:

=IF(OR(C6>0,D6>0),E5+C6-D6,"")
 
R

Roger Govier

Hi Trudy
Glad you got it sorted.
As I drove off to the pub, I suddenly thought it was quite illogical.
Why would you be wanting to add/subtract C6 and D6 if they were 0, but in
the haste of answering, I didn't consider the facts.
It's amazing how the thought of alcohol brings out the true logic<bg>

Regards

Roger Govier
 
Top