Excel Formula - Subtract

ststern45

Well-known Member
Joined
Sep 17, 2005
Messages
963
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hello everyone,

I have a formula question:

In cell A1 I have the value 121
I want to take each of the 3 numbers and subtract but as a final result want only a positive number
Example:

1-2 = 1
1-1 = 0

Result = 0 This is the result I'm looking for.

The normal method:
1-2 = -1
-1 - 1 = +2

Thank you in advance
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
-1 - 1 = -2, not +2.

If your A1 value is always 3 digits, then try:

Book1
AB
1121-2
Sheet8
Cell Formulas
RangeFormula
B1B1=SUM(MID(A1,{1,2,3},1)*{1,-1,-1})
 
Upvote 0
Thanks Eric.
Is there a formula where 121 (1 - 2 - 1) = 0?
Thanks
 
Upvote 0
There are lots of ways to get 0 from 121, taking each digit individually:

=SUM(MID(A1,{1,2,3},1)*{1,-1,1})

=SUM(MID(A1,{1,2,3},1)*{-1,1,-1})

=ABS(ABS(LEFT(A1)-MID(A1,2,1))-RIGHT(A1))

or even

=MOD(A1,11)

What are you trying to do? Do you have more examples?
 
Upvote 0
=ABS(ABS(LEFT(A1)-MID(A1,2,1))-RIGHT(A1))
This is the winner!
Thanks Eric for all your help!!
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,576
Members
449,173
Latest member
Kon123

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