Finding the differece between two cells

M

manickmj

Hello,

I am trying to get a formula to find the difference between two cells.

I tried the easy way which is =sum(a1-b1). the problem is that onl
works if the numbers are eithor both positive #'s or both negative #'s
It doesn't work if one is positive and one is negative.

Thank you in advance
Mike Manic
 
R

Ron Rosenfeld

Hello,

I am trying to get a formula to find the difference between two cells.

I tried the easy way which is =sum(a1-b1). the problem is that only
works if the numbers are eithor both positive #'s or both negative #'s.
It doesn't work if one is positive and one is negative.

Thank you in advance
Mike Manick

If I understand you correctly, how about:

=ABS(A1)-ABS(B1)


--ron
 
B

BenjieLop

The formula

=A1-B1

will work in all combinations of positive and/or negative numbers.
 
M

Myrna Larson

If you want the difference between -3 and +1 to be either -2 or +2, you aren't
using the same number system as the rest of the world <g>. To get from -3 to
+1, you have to add 4; going the other direction, +1 to -3, you have to
subtract 4.

The only formula you need is =A1-B1. Sum isn't necessary. You've specified the
operation by using the minus sign.

If for some reason you do want a result of +2 or -2, you can get that by
=ABS(A1)-ABS(B1).
 
Top