Adding Values

S

Steved

Hello from Steved

IF(P8<O8,P8+1-O8,P8-O8)+IF(R8>Q8,R8+1-Q8,R8-Q8)

O8 P8 Q8 R8
600,1800,0,0 for the above works

How do I correct the formula so that if I don't but zero's
in, the values in Q8 and R8 it will still add the values
in O8+P8

Thank you in advance.
 
J

JE McGimpsey

Your formula will work if Q8 and R8 are blank. If instead they have text
(like a space character), you'll get a #VALUE! error - is that what's
happening?

Try making sure the cells are really blank.
If you can't, SUM will ignore text, so that might be a way to go:

=SUM(P8,-N(O8),R8,-N(Q8))+(N(P8)<N(O8))+(N(R8)>N(Q8))

The boolean TRUE/FALSE values returned by the comparisons will be
coerced to 1/0, respectively.
 
S

Steved

JE thankyou very much. Your formula has corrected and yes
I was getting a #VALUE! error
Cheers.
 

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