Formulas

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.
 
J

Joe User

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.
 
P

Pete_UK

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
 
D

Daryl S

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.
 
R

Rumy

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.
 

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