ABS function
Returns the absolute value of a number: the number without its sign.
Available in All versions of Excel, Excel for the web, Excel for Mac
In every Excel versionWorks in Google Sheets
Syntax
ABS(number)| Argument | What it means | |
|---|---|---|
number | Required | The number whose size you want, positive or negative. |
Returns: A number greater than or equal to 0.
How ABS works
ABS removes the minus sign: ABS(-730) and ABS(730) both return 730. Use it whenever you care how big a difference is but not in which direction: how far actual spending is from budget, how far a measurement is from its target, how much stock moved in a day, or the size of a forecast error.
It is often combined with other functions: inside IF for tolerance checks, with SUMPRODUCT to add up sizes of mixed positive and negative values, or with MAX to find the largest deviation. Remember that ABS loses information on purpose; keep the original signed value if you also need to know whether you were over or under.
Examples
1Size of the budget variance
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Account | Budget | Actual | |
| 2 | Travel | 5000 | 5730 | 730 |
| 3 | Training | 3000 | 2410 | |
| 4 | Software | 8000 | 7950 |
Result: 730
Travel overspent by 730. Filled down, Training shows 590 (an underspend) and Software 50, so you can rank accounts by how far off they are.
2Tolerance check
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Part | Target (mm) | Measured (mm) | |
| 2 | Shaft A | 25 | 25.04 | OK |
| 3 | Shaft B | 25 | 24.93 |
Result: OK
Shaft A is 0.04 mm off, within ±0.05 mm. In D3, Shaft B is 0.07 mm off and shows Reject.
3Total stock movement
| A | B | |
|---|---|---|
| 1 | Day | Stock change |
| 2 | Mon | 120 |
| 3 | Tue | -85 |
| 4 | Wed | 40 |
| 5 | Thu | -150 |
| 6 | Fri | 60 |
| 7 | 455 |
Result: 455
The net change is −15, but the total quantity moved in and out is 120 + 85 + 40 + 150 + 60 = 455.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | The argument is text. | Check the input. |
Tips
- Largest deviation in Microsoft 365:
=MAX(ABS(C2:C4-B2:B4)). - Percentage variance regardless of direction:
=ABS(C2-B2)/B2. - Compare two decimals safely:
=ABS(A2-B2)<0.000001instead of=A2=B2.
Questions
How do I turn a column of negative numbers positive?
Use =ABS(A2) in a helper column, or Paste Special > Multiply by −1 if all are negative.
Can ABS make a number negative?
No. For a forced negative use =-ABS(A2).
Google Sheets
ABS also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
ABS in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
Recipes that use ABS
- How to calculate percentage change in Excel
- How to calculate the number of days between two dates in Excel
- How to compare two columns in Excel