Skip to content

ABS

Returns the absolute value of a number: its size without the sign. ABS(-12.5) and ABS(12.5) are both 12.5.

Syntax

=ABS()

Math and trigonometry

All versions of Excel.

Try it

Edit the formula in B2 or change the inputs. The sheet recalculates as you type.

B2
A
B
C
1
Value
ABS
2
-12.5
12.5
3

B2 =ABS(A2) returns 12.5

How ABS works

ABS returns a number's distance from zero. It turns a negative number into a positive one and leaves positive numbers and zero alone. Use it whenever the size of a difference matters but the direction doesn't.

Variance and error size

The most common use is the gap between two figures. =ABS(C2-B2) gives the difference between actual and budget as a positive number, whichever is bigger. To see how large the miss is as a share of the budget, divide: =ABS(C2-B2)/B2.

To judge a whole table, total the absolute differences with SUMPRODUCT: =SUMPRODUCT(ABS(C2:C9-B2:B9)). This is the sum of the errors with no cancelling out. Without ABS, an over-forecast in one row would cancel an under-forecast in another and make the total look better than it is.

Tolerance checks

ABS makes a "within tolerance" test work in both directions: =IF(ABS(C2-B2)<=50, "On budget", "Review") flags any row more than 50 away, high or low. Writing the same test without ABS needs two conditions joined with AND.

Sign handling

  • Take a debit or credit amount as a positive: =ABS(B2).
  • Compare the size of two signed numbers: =ABS(B2)>ABS(C2).
  • Use SIGN to recover the direction afterwards: =SIGN(B2)*ABS(B2) returns B2.

Compared with other functions

  • SIGN returns only the direction, 1, -1 or 0.
  • A formula such as =B2*-1 flips the sign of every number. ABS makes every number positive.
  • =MAX(B2, -B2) also returns the absolute value, but ABS is clearer.
  • SQRT fails on negative numbers, so =SQRT(ABS(B2)) is a way to avoid #NUM!, if taking the size of the number is really what you want.

Details

ABS works on numbers and on text that can be read as numbers. A cell containing "n/a" returns #VALUE!. Dates are numbers, so =ABS(A2-B2) gives the number of days between two dates, whichever comes first. A blank cell counts as 0.

Arguments

number
The number, cell or calculation to remove the sign from, such as B2 or C2-B2.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Remove the sign

B2 =ABS(A2)

Result: 12.5

The negative sign is removed. A positive number would be returned as it is.

B2
A
B
C
1
Value
ABS
2
-12.5
12.5
3

B2 =ABS(A2) returns 12.5

Example 2

The size of a variance

D3 =ABS(C3-B3)

Result: 300

Software came in 300 under budget. ABS reports the 300 without the minus sign.

D3
A
B
C
D
1
Item
Budget
Actual
Variance
2
Travel
5,000
5,400
3
Software
3,200
2,900
300
4
Training
1,500
1,500
5
Marketing
8,000
8,650
6

D3 =ABS(C3-B3) returns 300

Example 3

Variance as a share of budget

E3 =ABS(C3-B3)/B3

Result: 9.4%

300 divided by 3,200 is 9.375%.

E3
A
B
C
D
E
1
Item
Budget
Actual
Variance
% of budget
2
Travel
5,000
5,400
3
Software
3,200
2,900
9.4%
4
Training
1,500
1,500
5
Marketing
8,000
8,650
6

E3 =ABS(C3-B3)/B3 returns 9.4%

Example 4

Total of the absolute errors

B7 =SUMPRODUCT(ABS(C2:C5-B2:B5))

Result: 1,350

400 + 300 + 0 + 650. A plain total of the differences would be 750, because the software saving cancels part of the overspend.

B7
A
B
C
D
1
Item
Budget
Actual
2
Travel
5,000
5,400
3
Software
3,200
2,900
4
Training
1,500
1,500
5
Marketing
8,000
8,650
6
7
Total error
1,350
8

B7 =SUMPRODUCT(ABS(C2:C5-B2:B5)) returns 1,350

Example 5

A tolerance test in both directions

D4 =IF(ABS(C4-B4)<=50,"On budget","Review")

Result: On budget

Training is 20 over. The same test would catch it 20 under, with no second condition.

D4
A
B
C
D
1
Item
Budget
Actual
Status
2
Travel
5000
5400
3
Software
3200
2900
4
Training
1500
1520
On budget
5
Marketing
8000
8650
6

D4 =IF(ABS(C4-B4)<=50,"On budget","Review") returns On budget

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In D2, return the size of the forecast error: the gap between B2 and C2 without a sign. Fill it down to D6.

Answer in D2, then it fills down to D6.

D2
A
B
C
D
E
1
Item
Forecast
Actual
Error
2
Week 1
120
132
3
Week 2
95
90
4
Week 3
210
210
5
Week 4
60
72
6
Week 5
150
141
7
8
Total error

Common mistakes

  • ABS removes the sign, so the direction of a variance is lost. If the reader needs to know over or under, show the signed difference alongside, or use SIGN.
  • Taking ABS of a total of signed numbers is not the same as totalling the ABS of each row. ABS(SUM(...)) lets over- and under-runs cancel.
  • In older versions of Excel, SUM(ABS(range)) needs Ctrl+Shift+Enter. Use SUMPRODUCT instead, which handles arrays natively.
  • A blank cell counts as 0, so ABS of a missing figure looks like a real zero.
  • Text such as "n/a" returns #VALUE!. Clean the column or wrap the formula in IFERROR.

Questions people ask

How do I make a negative number positive in Excel?

Use `=ABS(B2)`. It returns the number without its sign: ABS(-12.5) is 12.5, and positive numbers are unchanged.

How do I find the difference between two numbers regardless of which is bigger?

Use `=ABS(B2-C2)`. Both orders give the same result.

How do I sum the absolute values of a range?

Use `=SUMPRODUCT(ABS(B2:B9))`. In Microsoft 365, `=SUM(ABS(B2:B9))` also works. In older versions it needs Ctrl+Shift+Enter.

What is the difference between ABS and SIGN?

ABS returns the size of a number and drops the direction. SIGN returns the direction as 1, -1 or 0 and drops the size.

How do I find the number of days between two dates, whichever is earlier?

Use `=ABS(A2-B2)`. Dates are numbers, so the difference is in days.

Learn ABS in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.