sum question

P

punter

Hi,

I'm having an issue getting a formula to work. I want to subtract I3
from E3. If that is anything besides zero I then want to subtract the
sum of N3 and O3 from the total of I3-E3. I'm going through my books
and the help topics but cant get it to work. Here is the formula I
have in there now: =sum(E3-I3)-sum(N3:03). I only want it to
subtract the second part of the formula if the first part (E3-I3) is
anything but 0.

Any thoughts?

Thanks

Eddie
 
B

Bernard Liengme

First of all let's clear up SUM. You generally use this for something like
=SUM(A1:A10); this sums A1+A2,+A3....+a10
But =SUM(E3-I3) while not wrong, is unnecessary; just use =E3-I3.
And SUM(N3:O3) is better written as =N3+O3 in most cases

Your problem is solved with =IF(E3-I3<>0, E3-I3-(N3+O3),0)
I assume you want zero when (E3_I3) is zero
best wishes
 
B

Bob Phillips

If you want 0 even if I3>e3 then

=MAX(E3-I3-(N3+O3),0)

otherwise

=E3-I3-(N3+O3)*(E3-I3>0)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top