Excel function

ABSfunction

Returns the absolute value of a number (the number without its sign).

All versions
=ABS(A2)
A
B
1
2
3
4
5
6
7

Click a cell in the table to change number. Click a negative value. Try breaking it on purpose to see the errors.

Result

3.14159

number
A2You can also click a cell in the table

The cell with the number to calculate. Click another value in the table.

What is the ABS function?

=ABS(number)

ABS returns the absolute value of a number, the number without its sign. Use it to compare differences or errors regardless of direction.

Positive numbers and 0 stay the same; negative numbers become positive.

ABS checks whether a measurement is within tolerance of its target, or compares the size of budget variances. Because it measures only the size of a difference, not its direction, it is usually paired with IF.

Arguments

number
The number or cell to get the absolute value of.

ABS examples

  1. Example 1. Example from Microsoft

    =ABS(-2)

    Returns 2.

  2. Example 2. Size of a difference

    =ABS(B2-C2)

    The gap between target and actual, without a sign.

  3. Example 3. Pass or fail on tolerance

    =IF(ABS(B2-C2)<=0.05, "OK", "NG")

    Passes when the measured value C2 is within ±0.05 mm of the spec B2.

    Spec B2Measured C2ABS(B2-C2)Result
    10.0010.030.03OK
    10.009.940.06NG
    10.009.960.04OK
  4. Example 4. Total size of the variances

    =SUMPRODUCT(ABS(C2:C10-B2:B10))

    Adds budget-versus-actual differences without signs, so overs and unders do not cancel out.

Common mistakes

FAQ

How do I turn only negatives into 0?
Use =MAX(A2, 0).
Absolute value of a total?
Wrap it: =ABS(SUM(A2:A10)).
Why use it before SQRT?
The square root of a negative number is #NUM!, so =SQRT(ABS(A2)) removes the sign first.