Adding Values

  • Thread starter Thread starter Steved
  • Start date Start date
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.
 
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.
 
JE thankyou very much. Your formula has corrected and yes
I was getting a #VALUE! error
Cheers.
 
Back
Top