Nested if

N

Nigel

Thius is a stupid question but I cannot for the life of me work it out

the calculation I need is

if C4=0 or if D4 = 0 then 0 else c4-d4
 
D

David Biddulph

You don't need to nest IFs.
=IF(OR(C4=0,D4=0),0,C4-D4)

If you particularly want to nest IFs:
=IF(C4=0,0,IF(D4=0,0,C4-D4))
 
K

Kevin B

Unless you formulated your intitial question incorrectly, it works just fine.
Dave Biddulph has given the same formula along with an "If you have to nest"
IF formula.
 
D

David Biddulph

"That doesn't work" wins the prize for the most unhelpful post of the day.

If you had wanted further help, you would have told us what values you had
as your inputs, what result you got from the formula, and what result you
expected, but as you did not give any of that information we can't tell you
what you did wrong.
[Kevin's formula was correct, of course, so if that isn't the right answer
it means you asked the wrong question.]
 
N

Nigel

Sorry Kevin, my mistake, the value in C4 or D4 is actually a text field
(retreiving from Essbase) so thats why it didn't work its fine now

thanks
 
Top