Abs Value Excel: How to Use the ABS Function
In this article
To get the absolute value in Excel, use the =ABS() function. This formula removes the negative sign from a number, converting any negative value into its positive equivalent while leaving positive numbers and zeros unchanged. For example, =ABS(-10) results in 10, and =ABS(10) also results in 10.
What You'll Need
- A computer with Microsoft Excel installed (works in all versions, including Excel 365, 2021, 2019, and Excel for the Web).
- A dataset containing positive and negative numbers, or a specific cell reference you wish to convert.
Step-by-Step
- Identify your target data: Locate the cell or range of cells containing the numbers you want to convert to absolute values. For instance, if your negative numbers are in column A, starting at cell A2, this is your target.
- Select the output cell: Click on the cell where you want the result to appear. It is generally best practice to keep your original data intact and place the absolute values in a new column (e.g., column B).
- Enter the function: Type
=ABS(into the formula bar or directly into the cell. - Specify the argument: You have three options for what to put inside the parentheses:
- Cell Reference: Click on the cell containing the number (e.g.,
=ABS(A2)). This is the most flexible method because if the value in A2 changes, the absolute value updates automatically. - Static Number: Type the number directly (e.g.,
=ABS(-50)). This is useful for one-off calculations. - Formula or Calculation: You can place a mathematical operation inside the function. For example, if you want the absolute difference between two cells, use
=ABS(A2-B2).
- Cell Reference: Click on the cell containing the number (e.g.,
- Complete the formula: Type the closing parenthesis
)and press Enter. - Apply to multiple cells: To convert a whole list of numbers, hover your mouse over the bottom-right corner of the cell containing your formula until the cursor turns into a small black cross (the Fill Handle). Click and drag the handle down to the bottom of your dataset. Excel will automatically adjust the cell references for each row (e.g., A2 becomes A3, A4, etc.).
Common Mistakes
One of the most frequent errors is attempting to use the ABS function to change the formatting of a cell rather than its value. The ABS function creates a new value; it does not simply "hide" the minus sign. If you need the minus sign to disappear for visual reasons only, you would use Custom Number Formatting, not a formula.
Another common mistake is forgetting the equal sign (=) at the start of the formula. Without the equal sign, Excel treats ABS(A2) as plain text rather than a functional command, and no calculation will occur.
Users also sometimes confuse absolute value with "absolute references." In Excel, an absolute reference (like $A$1) locks a cell so it doesn't change when copied. The ABS() function is a mathematical operation and has nothing to do with locking cells with dollar signs.
Finally, some users try to nest too many functions inside the ABS formula without proper parentheses. If you are performing a complex calculation inside =ABS(), ensure every opening parenthesis has a corresponding closing parenthesis, or Excel will return a formula error.
Tips
Calculating Variance: The ABS function is incredibly powerful when calculating the difference between two values where the direction (positive or negative) doesn't matter. For example, if you are comparing "Actual Spend" vs "Budgeted Spend," you might only care about the size of the gap. Using =ABS(Actual-Budget) gives you the raw variance regardless of whether you were over or under budget.
Combining with SUM: If you want to find the total distance moved or total change regardless of direction, you cannot simply sum a column of positive and negative numbers, as they will cancel each other out. Instead, create a helper column using =ABS() for every entry, and then use the =SUM() function on that helper column.
Using Array Formulas: In modern versions of Excel (Office 365), you can use the ABS function on an entire range at once. Instead of dragging the fill handle, you can type =ABS(A2:A100). Excel will "spill" the results into the cells below automatically, which is much faster for large datasets.
Data Validation: Use ABS in conjunction with data validation if you want to ensure that users only enter positive values, or to normalize data before it is used in a VLOOKUP or MATCH function where negative signs might cause a mismatch.
Troubleshooting
If your formula is not working as expected, check these common issues in order:
The result is #VALUE!: This error usually occurs because the cell you are referencing contains text instead of a number. Check for hidden spaces or characters. If the number is stored as text, the ABS function cannot perform a mathematical operation on it. You can fix this by selecting the column, going to the Data tab, selecting Text to Columns, and clicking Finish to force Excel to recognize the numbers.
The formula is displayed as text: If you see =ABS(A2) in the cell instead of the result, the cell is likely formatted as "Text." Change the cell format to "General" via the Home tab in the Number group, then double-click the cell and press Enter again to trigger the calculation.
The result is 0: Ensure that the cell you are referencing isn't actually empty. Excel often treats an empty cell as 0, so =ABS(EmptyCell) will return 0.
Circular Reference Warning: If you get a circular reference error, it means you placed the formula in the same cell that the formula is referencing. For example, putting =ABS(A2) inside cell A2. Move the formula to a different cell to resolve this.
Frequently Asked Questions
Can the ABS function be used with dates?
Yes, because Excel stores dates as serial numbers. If you subtract one date from another, you get the number of days between them. If the result is negative, wrapping it in =ABS() will give you the positive number of days between those two dates regardless of which one came first.
Does ABS work in Google Sheets?
Yes, the =ABS() function works exactly the same way in Google Sheets as it does in Microsoft Excel, using the same syntax and arguments.
Is there a way to convert negative numbers to positive without a formula?
Yes. You can type -1 into an empty cell and copy it. Then, select the range of negative numbers, right-click, choose Paste Special, select Multiply, and click OK. This multiplies all selected cells by -1, turning negatives into positives (and positives into negatives).
Can I use ABS with the IF function?
Absolutely. A common use case is =IF(ABS(A2)>10, "Out of Range", "OK"). This checks if the magnitude of the number is greater than 10, regardless of whether it is positive or negative.
Does ABS remove the negative sign from a text string?
No. If the "negative number" is actually a text string (e.g., "-10 USD"), the ABS function will return a #VALUE! error. You must first strip the non-numeric characters using functions like SUBSTITUTE or LEFT/RIGHT before applying ABS.