Absolute Value in Excel: How to Use the ABS Function – LicenceHouse guide

To get the absolute value in Excel, use the ABS function: type =ABS(A2) in a cell and press Enter. ABS returns the number without its sign, so -45 becomes 45 and 45 stays 45. You can also find it under Formulas > Math & Trig > ABS, and you can wrap it around any formula that returns a number.

Task Formula Result for -12.5
Absolute value of one cell =ABS(A2) 12.5
Absolute difference of two cells =ABS(A2-B2) Distance between the values
Sum of absolute values =SUMPRODUCT(ABS(A2:A10)) Total ignoring signs
Mean absolute deviation =AVEDEV(A2:A10) Average distance from the mean
Force a number negative =-ABS(A2) -12.5

What is the absolute value function in Excel?

The absolute value function in Excel is ABS, and it returns the distance of a number from zero. Its syntax has a single required argument: ABS(number). The argument can be a typed number, a cell reference or another formula. Positive numbers and zero come back unchanged, and negative numbers lose their minus sign.

ABS is one of the oldest functions in Excel. It works the same in Excel 2016, 2019, 2021, 2024, Microsoft 365, Excel for Mac and Excel for the web, so you don't need a newer version to use it. Microsoft's ABS function reference confirms the one-argument syntax.

If the argument is text that Excel can't read as a number, such as "n/a", ABS returns the #VALUE! error. An empty cell counts as zero, so =ABS(B5) on a blank cell returns 0.

How do I use the absolute value formula in Excel?

Using absolute value in Excel takes three steps, and the formula then copies down like any other.

Three steps to use ABS in Excel: click cell B2, type =ABS(A2) and press Enter, then drag the fill handle down the column.

  1. Click the cell where you want the result, for example B2.
  2. Type =ABS(, click cell A2, type ) and press Enter.
  3. Drag the fill handle (the small square at the bottom-right of B2) down to copy the formula to the rest of the column.

Here is a worked example. Column A holds monthly budget variances, some over and some under.

Cell A: Variance B: =ABS(A2)
Row 2 -320 320
Row 3 150 150
Row 4 -75 75
Row 5 0 0
Row 6 410 410

Column B now shows how far each month was from budget, whatever the direction. That is the usual reason to use absolute numbers in Excel: you care about the size of a gap, not whether it was above or below a target. If you're new to building formulas from cell references, our guide to basic maths formulas in Excel covers the essentials.

How do I find the absolute difference between two numbers?

Subtract one value from the other inside ABS: =ABS(A2-B2). The result is always positive, so it doesn't matter which column you subtract first. This is handy for comparing a forecast with an actual figure, or a target weight with a measured one.

Formula =IF(ABS(A2-B2)>100,"Check","OK") broken into parts: ABS(A2-B2) gives a positive gap, flagged Check when over 100.

You can combine it with IF to flag large gaps. For example, =IF(ABS(A2-B2)>100,"Check","OK") marks any row where the two values differ by more than 100 in either direction. Our guide to IF then statements in Excel explains the IF part in more detail.

What we commonly see: people try to get a positive difference with =MAX(A2,B2)-MIN(A2,B2) or by multiplying by -1 in a helper column. Both work, but they're longer and break easily when someone edits one column. A single =ABS(A2-B2) is clearer, and anyone auditing the sheet sees the intent at once.

How do I sum absolute values in Excel?

Use =SUMPRODUCT(ABS(A2:A10)) to add up a range while ignoring the signs. SUMPRODUCT handles the array of ABS results in every version of Excel without any special keystrokes.

In Excel 2021, Excel 2024 and Microsoft 365 you can also type =SUM(ABS(A2:A10)) and press Enter, because these versions evaluate arrays natively. In Excel 2016 and 2019 the same SUM formula must be confirmed with Ctrl+Shift+Enter as an array formula, otherwise it may return a wrong answer or an error. If you share workbooks with people on older versions, SUMPRODUCT is the safer choice.

A third option avoids ABS entirely: =SUMIF(A2:A10,">0")-SUMIF(A2:A10,"<0"). It adds the positives and subtracts the (negative) total of the negatives, which gives the same result. It's useful when you also need the positive and negative totals separately.

How do I calculate absolute deviation and mean absolute deviation in Excel?

Excel has a built-in function for mean absolute deviation: =AVEDEV(A2:A10). It returns the average of the absolute distances between each value and the mean of the set, which is a simple, easy-to-explain measure of spread. Microsoft's AVEDEV function page notes that it accepts up to 255 arguments, or a single range.

Worked example of absolute deviation: values 4, 8, 5 and 7 with mean 6 give deviations 2, 2, 1, 1; AVEDEV returns 1.5.

To see the absolute deviation for each row, add a helper column. With data in A2:A10, put this in B2 and fill down:

=ABS(A2-AVERAGE($A$2:$A$10))

Then =AVERAGE(B2:B10) gives the same answer as AVEDEV. The dollar signs lock the range so it doesn't shift as you copy down. Worked example:

Value (A) Mean Absolute deviation (B)
4 6 2
8 6 2
5 6 1
7 6 1

The mean absolute deviation is (2 + 2 + 1 + 1) / 4 = 1.5, and =AVEDEV(A2:A5) returns 1.5 as well. If you need deviation around a figure other than the mean, such as a target or the median, swap the AVERAGE part for that value: =AVERAGE(ABS(A2:A10-MEDIAN(A2:A10))) works directly in Excel 2021 and later.

Advanced nuance: mean absolute deviation is not the same as standard deviation. STDEV.S squares each distance, so outliers pull it up much more strongly. AVEDEV treats every unit of distance equally, which is why forecasters often prefer the related mean absolute error, =AVERAGE(ABS(actual-forecast)), when they want a figure that reads in the same units as the data. Averages of averages can mislead in similar ways; our guide to the average of averages in Excel explains why.

Is "absolute" in Excel the same as an absolute reference?

No. ABS changes a number's sign, while an absolute reference such as $A$1 locks a cell address so it doesn't change when you copy a formula. The word "absolute" is shared, which causes plenty of confusion in searches.

To make a reference absolute, click inside the reference in the formula bar and press F4 on Windows. Each press cycles through $A$1, A$1, $A1 and A1. On a Mac, press Cmd+T, or Fn+F4 on some keyboards. The helper-column formula above uses both ideas at once: ABS for the value and $A$2:$A$10 to keep the mean pointing at the full range.

Does ABS work the same in every Excel version?

Yes, ABS itself is identical across Excel 2016, 2019, 2021, 2024, Microsoft 365, Mac and the web. What changes between versions is how array formulas around it behave. Formulas like =SUM(ABS(A2:A10)) or =AVERAGE(ABS(A2:A10-AVERAGE(A2:A10))) work with a plain Enter only in Excel 2021, 2024 and Microsoft 365, which support dynamic arrays. On 2016 or 2019 you need Ctrl+Shift+Enter or the SUMPRODUCT alternative.

Office 2019 support ended on 14 October 2025 and Office 2021 support ended on 13 October 2026, so if you're still on either, it may be time to plan an upgrade. Excel 2024 is supported until 9 October 2029. You can compare editions in our Office 2024 licence keys collection.

Frequently asked questions

How do I make all numbers positive in Excel?

Put =ABS(A2) in a spare column, fill it down, then copy the results and use Paste Special > Values to replace the originals if you no longer need the signs. If you only want to display numbers without a minus sign but keep the true values, use a custom number format such as 0;0 instead. That changes how the cells look, not what they contain.

Why does my ABS formula return #VALUE!?

ABS returns #VALUE! when its argument is text that Excel can't convert to a number. This often happens with figures imported from other systems, which may include stray spaces, currency symbols or a trailing minus sign such as "45-". Clean the source data first, or wrap the cell in VALUE, for example =ABS(VALUE(TRIM(A2))), so Excel reads it as a number before ABS runs.

Can I use ABS with conditional formatting?

Yes. Select your range, go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format, and enter a rule such as =ABS($C2)>50. Excel then highlights rows where the variance in column C is more than 50 in either direction. Keep the dollar sign before the column letter so the rule checks the same column on every row.

What is the difference between AVEDEV and STDEV in Excel?

AVEDEV returns the mean absolute deviation, the plain average distance of each value from the mean. STDEV.S and STDEV.P square those distances before averaging and then take the square root, which gives large deviations more weight. AVEDEV is easier to explain to non-specialists. Standard deviation is the usual choice for statistical tests and confidence intervals.

Is there a shortcut to insert the ABS function?

There is no dedicated shortcut, but typing is fast: enter =AB and Excel's formula AutoComplete suggests ABS, so press Tab to accept it. You can also click the Insert Function button (fx) next to the formula bar, search for ABS and pick it. The function is also listed under Formulas > Math & Trig on the ribbon.

Related guides

Links in this guide

Link Type Why it helps
Microsoft Support: ABS function External Official syntax and examples for ABS
Microsoft Support: AVEDEV function External Official reference for mean absolute deviation
Basic maths formulas in Excel Internal Foundation for writing cell-reference formulas
IF then statements in Excel Internal Flag rows where an absolute gap is too large
Average of averages in Excel Internal Avoid another common averaging mistake
Office 2024 licence keys Internal Upgrade path for dynamic-array formulas
Stop Excel rounding numbers Internal Control decimals in ABS results
Data analysis, Excel, Excel formulas, How-to