Math & Trig

ABS Function in Excel

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

Syntax

  • =ABS(number)

Arguments

  • number (required): The number to get absolute value of

Examples

  • =ABS(-5) - Absolute value of -5 - Result: 5
  • =ABS(A1-B1) - Absolute difference between two values - Result: Positive difference
  • =IF(ABS(A1-B1)<0.01, "Equal", "Different") - Compare with tolerance - Result: Comparison result

Excel ABS function documentation

  • ABS returns the absolute value of a number — the magnitude without the sign. =ABS(-5) is 5 and =ABS(5) is 5.
  • Syntax is =ABS(number). The argument can be a literal, a cell, or a formula such as a difference between two cells.
  • Use ABS when the direction of a change does not matter: forecast error, budget variance, or the gap between two prices.
  • ABS works on real numbers only. For complex numbers use IMABS. Related: [SIGN](/functions/sign/), [ROUND](/functions/round/), [IF](/functions/if/).

Step-by-step: absolute difference and tolerance

  • Step 1 — Subtract the two values, for example actual minus budget in C2: =A2-B2. The sign shows over or under.
  • Step 2 — Wrap the difference: =ABS(A2-B2) when a report should show the size of the gap only.
  • Step 3 — Compare floats with a tolerance: =IF(ABS(A2-B2)<0.01,"Match","Review"). Tiny leftovers from division should not look like real gaps.
  • Step 4 — Keep the signed variance in a helper column when stakeholders still need to know which side missed the target.

ABS patterns to copy

  • Forecast error magnitude: =ABS(Actual-Forecast). Average those values for mean absolute error.
  • Closest match: =MIN(ABS(target-range)) finds the smallest gap; combine with MATCH on a helper column of absolute gaps.
  • Percentage points: =ABS(new_rate-old_rate) when you report how far a rate moved, not whether it rose or fell.
  • ABS does not remove #DIV/0! or #N/A. Fix the source formula first, then take the absolute value of a numeric result.

Common errors

  • Returns positive value regardless of input sign

Use cases

  • Distance calculations
  • Variance analysis
  • Error tolerance checks

Frequently asked questions

  • What is ABS function used for? ABS returns the absolute (positive) value of a number. -5 becomes 5, 5 stays 5. Common uses: calculating distances/differences regardless of direction, comparing values with tolerance, and ensuring positive results.
  • How do I calculate the difference between two numbers? Use =ABS(A1-B1) to get the positive difference regardless of which is larger. This avoids negative results when B1>A1.
  • How do I compare floating-point numbers with ABS? Due to floating-point precision, use tolerance: =IF(ABS(A1-B1)<0.0001, "Equal", "Different"). This handles tiny differences from calculations that should be equal.
  • Can ABS work with complex numbers? No, ABS only works with real numbers. For complex numbers, use IMABS: =IMABS(COMPLEX(3,4)) returns 5 (the magnitude of 3+4i).
  • What is the difference between ABS and SIGN? ABS returns the magnitude (always positive). SIGN returns the sign: -1 for negative, 0 for zero, 1 for positive. To reconstruct: number = ABS(number) * SIGN(number).

Editorial review

  • Reviewed by Excel.Directory Editorial Team. Updated May 2026.