Difference between two numbers

robertdseals

Active Member
Joined
May 14, 2008
Messages
337
Office Version
  1. 2010
Platform
  1. Windows
How do I get the difference between two numbers. The problem is sometime both numbers will be positive, sometimes the first is positive and the second negative, sometimes the first is negative and the second is positive, sometimes they are both negative.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
How do I get the difference between two numbers. The problem is sometime both numbers will be positive, sometimes the first is positive and the second negative, sometimes the first is negative and the second is positive, sometimes they are both negative.
Maybe this...

With your numbers in A1 and B1:

=ABS(A1)-ABS(B1)

Or, the other way around:

=ABS(B1)-ABS(A1)
 
Upvote 0
Not sure that would work because if the first number is 1000 and the second is -100 you would get 900 instead of 1100.
 
Upvote 0
100 to 500 would be 400. -100 to 500 would be 600. -100 to -500 would be 400. -200 to 300 would be 500.
 
Upvote 0
100 to 500 would be 400. -100 to 500 would be 600. -100 to -500 would be 400. -200 to 300 would be 500.
Try this...

Book1
ABC
1Value1Value2Diff
2100500400
3-100500600
4-100-500400
5-200300500
Sheet1

This formula entered in C2 and copied down:

=ABS(B2-A2)
 
Upvote 0

Forum statistics

Threads
1,225,844
Messages
6,187,352
Members
453,419
Latest member
Plane11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top