Formulas

  • Thread starter Thread starter Rumy
  • Start date Start date
R

Rumy

I have dollar amounts in cells A1, B1, C1 and D1. I need a formula in cell
E1 to give me the sum of A1+B1 or the sum of C1-D1 if the sum of A1+B1 = 0.
I have over 5000 rows. Thanks.
 
Rumy said:
I have dollar amounts in cells A1, B1, C1 and D1. I need a formula in cell
E1 to give me the sum of A1+B1 or the sum of C1-D1 if the sum of A1+B1 =
0.
I have over 5000 rows.

=IF(A1+B1=0, C1-D1, A1+B1)

Caveat: If A1 and/or B1 does not contain constants, or if they have
opposite signs, their sum might appear to be zero, but it might not be
exactly zero. To avoid suprises, it would be safer to write the following:

=IF(ROUND(A1+B1,2)=0, C1-D1, A1+B1)

Change ROUND(...,2) to ROUND(...,0) if you expect only "dollar amounts", not
dollar-and-cents amounts.
 
Put this in E1:

=IF(A1+B1=0,C1-D1,A1+B1)

Then copy it down as far as you need it.

Hope this helps.

Pete
 
Rumy -

Try this:
Put the following formula in cell E1:
=if(A1+B1=0,C1-D1,A1+B1)
Now copy/paste or drag the formula down the rest of column E.
 
Thanks. that works.

Daryl S said:
Rumy -

Try this:
Put the following formula in cell E1:
=if(A1+B1=0,C1-D1,A1+B1)
Now copy/paste or drag the formula down the rest of column E.
 
Back
Top