ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Math
  3. Absolute Value in Excel: How the ABS Function Works

Absolute Value in Excel: How the ABS Function Works

By ExcelReady Team·Updated November 2, 2026·7 min read

The short answer

To get the absolute value in Excel, use =ABS(number), for example =ABS(A2). ABS removes the minus sign, so -25 becomes 25 and 25 stays 25. It is most useful for differences in either direction, such as =ABS(C2-B2) for the gap between actual and budget, and =SUMPRODUCT(ABS(C2:C7-B2:B7)) to total those gaps.

Key takeaways

  • =ABS(number) returns the number without its sign: -25 and 25 both give 25.
  • =ABS(C2-B2) measures how far apart two values are, whichever one is bigger.
  • =SUMPRODUCT(ABS(range)) adds absolute values in any version, with no special keys.
  • For percent change from a negative start, divide by ABS(old) so the sign shows the right direction.
  • ABS changes negatives to positives; MAX(0,value) changes negatives to zero. They solve different problems.
On this page+
  1. What does the ABS function do?
  2. How to find the difference between two numbers with ABS
  3. How to sum absolute values in Excel
  4. How to fix percent change from a negative number
  5. Other everyday uses of ABS
  6. ABS vs turning negatives into zero
  7. How to remove minus signs without a formula
  8. Practise it

The absolute value of a number is its distance from zero, without a plus or minus sign. In Excel you get the absolute value with the ABS function: =ABS(A2) turns -25 into 25 and leaves 25 as 25. This guide shows what ABS does, then the jobs where it really helps: measuring differences, totalling variances, fixing percent change from a negative start and finding the closest match.

What does the ABS function do?#

ABS takes one number and returns it without its sign. The syntax is:

Excel formula
=ABS(number)

The number can be typed in, a cell reference or a formula. Here is what ABS returns for different inputs:

FormulaResultWhy
=ABS(-25)25The minus sign is removed
=ABS(25)25Positive numbers don't change
=ABS(0)0Zero has no sign
=ABS(-3.75)3.75Decimals keep their digits
=ABS(A2) with A2 empty0An empty cell counts as 0
=ABS("hello")#VALUE!Text can't be a number

ABS works in every version of Excel, on Windows, Mac and the web. Note that ABS only changes the result of the formula. The original cell still holds its negative number.

How to find the difference between two numbers with ABS#

The most common use of ABS is a difference that doesn't care which number is bigger. A plain subtraction gives a negative result when the second number is larger. ABS gives the size of the gap either way.

All the examples below use this monthly budget in A1:C7:

ABC
1ItemBudgetActual
2Rent1,2001,200
3Food450512
4Transport180143
5Utilities160171
6Fun200265
7Savings300250

In D2, type =C2-B2 and fill down: you get 0, 62, -37, 11, 65 and -50. The signs tell you the direction (over or under budget). In E2, type =ABS(C2-B2) and fill down: you get 0, 62, 37, 11, 65 and 50. That is how far off each line was, whatever the direction.

Keep both columns when you report variances. The signed column tells the story, and the absolute column tells you which lines need the most attention. The budget math practice lesson drills this kind of variance work.

How to sum absolute values in Excel#

To add up absolute values, put ABS inside SUMPRODUCT. SUMPRODUCT works with whole ranges, so you don't need a helper column:

Excel formula
=SUMPRODUCT(ABS(C2:C7-B2:B7))

The result is 225 (0 + 62 + 37 + 11 + 65 + 50). Compare it with the plain total of the differences:

FormulaResultWhat it tells you
=SUM(C2:C7)-SUM(B2:B7)51Overall you spent 51 more than planned
=SUMPRODUCT(ABS(C2:C7-B2:B7))225The lines were off by 225 in total

The net figure of 51 hides a lot, because overspends and underspends cancel out. The absolute total shows how accurate the budget really was.

Why SUMPRODUCT and not SUM? In Microsoft 365 and Excel 2021, =SUM(ABS(C2:C7-B2:B7)) also returns 225. In older versions, SUM with a range calculation inside needs Ctrl+Shift+Enter, or it may return #VALUE! or a wrong result. SUMPRODUCT handles arrays in every version. The SUMPRODUCT function guide explains how it works.

To sum the absolute values of a single column, such as a list of positive and negative amounts in A2:A20, use =SUMPRODUCT(ABS(A2:A20)). The formula =SUMIF(A2:A20,">0")-SUMIF(A2:A20,"<0") gives the same answer without arrays.

How to fix percent change from a negative number#

The usual percent change formula is =(new-old)/old. It breaks when the old value is negative, because dividing by a negative flips the sign.

Say a small business had a profit of -200 (a loss) last year and 100 this year. That is a clear improvement:

FormulaResultCorrect?
=(100-(-200))/-200-150%No, shows a fall
=(100-(-200))/ABS(-200)150%Yes, shows a rise

So with cells, write:

Excel formula
=(C2-B2)/ABS(B2)

When the old value is positive, ABS changes nothing, so the same formula is safe for every row. Percent change from a negative start is still hard to read, so many reports show "n/a" instead for those rows. The guide to the percent change formula covers this, and the percent change lesson lets you practise it.

Other everyday uses of ABS#

Check whether two numbers match within a tolerance#

Rounding can make two totals differ by a cent. ABS lets you accept small gaps:

Excel formula
=IF(ABS(B2-C2)<=0.01,"Match","Check")

This says Match when the gap is a cent or less in either direction. More ways to test cells are in the guide to comparing two cells.

Find the closest value to a target#

ABS turns "closest" into "smallest gap". In Microsoft 365 or Excel 2021, this returns the item whose actual spend is closest to 150:

Excel formula
=XLOOKUP(MIN(ABS(C2:C7-150)),ABS(C2:C7-150),A2:A7)

The gaps are 1,050, 362, 7, 21, 115 and 100, so the result is Transport (143). The article on finding the closest match covers versions without XLOOKUP.

Take the square root of a negative number#

=SQRT(-16) returns #NUM!, because a negative number has no real square root. If you only need the size, use =SQRT(ABS(-16)), which returns 4. See square roots and powers in Excel for more.

ABS vs turning negatives into zero#

ABS and MAX(0, …) both get rid of negative results, but in different ways:

Value=ABS(A2)=MAX(0,A2)
-50500
000
626262

Use ABS when the size matters and the sign doesn't, such as a variance or a distance. Use MAX(0, …) when a negative result should not exist, such as a bonus or a stock level that can't go below zero. The guide to turning negative numbers into zero covers that case.

How to remove minus signs without a formula#

Sometimes you want the cells themselves to change. There are two safe ways:

  1. Helper column, then paste values. Put =ABS(A2) in an empty column, fill it down, copy it, and paste it over the original as values (Windows: Ctrl+Alt+V, then V; Mac: ⌃⌘V, then choose Values). Delete the helper column.
  2. Change only the display. A custom number format of 0;0 shows -50 as 50, but the cell still holds -50, so totals don't change. Use this only when the sign really doesn't matter to anyone reading.

Avoid Find and Replace on the minus sign: it also changes formulas, dates and text that contain hyphens.

Practise it#

Try the exercise on this page: it is the total absolute variance from the budget above, and the answer should be 225. Then practise budget calculations in a live spreadsheet, where you type each formula and it checks the result instantly, and move on to the percent change lesson to use ABS where it matters most.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

How far off budget were you in total, ignoring whether each line was over or under? In E2, use SUMPRODUCT with ABS to add up the absolute differences between Actual (C2:C7) and Budget (B2:B7).

fx
ABCDEF
1
Item
Budget
Actual
Total absolute variance
2
Rent
1200
1200
3
Food
450
512
4
Transport
180
143
5
Utilities
160
171
6
Fun
200
265
7
Savings
300
250
8
9
10

Tip: C2:C7-B2:B7 gives each difference. ABS removes the minus signs, and SUMPRODUCT adds them up.

Practise this in a lesson

LessonPercentages and % changeCalculate percent change with (new - old) / old, format it as a percentage, and grow a number by a percent.LessonPractice: department budgetCombine SUM, AVERAGE, ROUND and absolute references in a realistic budget sheet.Function guideSUMPRODUCTMultiply columns and add the results in one step with SUMPRODUCT. Totals, weighted averages, conditions, and a live exercise to try.

Frequently asked questions

What is the absolute value formula in Excel?

+

Use =ABS(number). For example, =ABS(A2) returns the value in A2 without a minus sign, and =ABS(-7.5) returns 7.5.

How do I sum absolute values in Excel?

+

Use =SUMPRODUCT(ABS(A2:A10)). It works in every version without Ctrl+Shift+Enter. In Microsoft 365, =SUM(ABS(A2:A10)) also works.

How do I make negative numbers positive in Excel?

+

Put =ABS(A2) in a helper column and fill it down. To replace the originals, copy the results and paste them back as values, then delete the helper column.

Why does ABS return #VALUE!?

+

The cell holds text that Excel can't read as a number, such as a word or a number with extra characters. Clean the text first, for example with TRIM or SUBSTITUTE, or convert it with VALUE.

Sources

  • ABS function - Microsoft Support
  • SUMPRODUCT function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What does the ABS function do?
  2. How to find the difference between two numbers with ABS
  3. How to sum absolute values in Excel
  4. How to fix percent change from a negative number
  5. Other everyday uses of ABS
  6. ABS vs turning negatives into zero
  7. How to remove minus signs without a formula
  8. Practise it

Keep reading

Math· 6 min read

Percent Change Formula in Excel (With Examples)

The percent change formula in Excel is =(new-old)/old. If last year's sales are in B2 and this year's in C2, type =(C2-B2)/B2, then press Ctrl+Shift+% to show it as a percentage. A positive result is an increase and a negative result is a decrease. Always divide by the old value.

Text· 6 min read

Compare Two Cells in Excel (Exact, Ignoring Case or Spaces)

To compare two cells in Excel, type =A2=B2. It returns TRUE if they match and FALSE if they don't, and it ignores capital letters. Use =EXACT(A2,B2) when case matters, =TRIM(A2)=TRIM(B2) to ignore extra spaces, and wrap any of these in IF to show words like "Match" or "Different" instead of TRUE or FALSE.

Lookups· 6 min read

Find the Closest Match in Excel

To find the closest match in Excel, measure how far each value is from your target with ABS, then look up the smallest gap: =XLOOKUP(MIN(ABS(B2:B8-E1)),ABS(B2:B8-E1),A2:A8). This works on unsorted data in Excel 2021 or Microsoft 365. If you only want the next smaller or next larger value, use XLOOKUP's match_mode -1 or 1 instead.

More on math

  • AutoSum in Excel: The Alt+= Shortcut Explained
  • AVERAGE, MIN and MAX in Excel With Examples
  • How to Average Percentages in Excel Correctly
  • How to Average Without Zeros or Blanks in Excel
  • CAGR Formula in Excel: Compound Annual Growth Rate
  • How to Calculate Discounts and Sale Prices in Excel
All math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free