LearnExcel.io
Menu

How to Calculate Difference in Excel

Written by ··Updated June 14, 2026

To calculate the difference between two numbers in Excel, type =A2-B2 into an empty cell, where A2 is the larger value and B2 is the value you are subtracting. Press Enter and Excel returns the difference. That single subtraction formula is all you need for most jobs, but Excel also gives you ready-made ways to get the absolute difference, the percentage change, and the gap between two dates or times.

This guide covers every variation behind those goals: plain subtraction, the ABS function, percentage change, date and time differences, keyboard shortcuts, the differences between Windows and Mac, and how to fix the errors that trip people up.

The fastest answer: simple subtraction

Excel has no dedicated “SUBTRACT” function. Subtraction is done with the minus sign (-) inside a formula. Every formula begins with an equals sign so Excel knows to calculate rather than store text.

  1. Click the cell where you want the result (for example C2).
  2. Type =A2-B2.
  3. Press Enter.

If A2 holds 20 and B2 holds 10, C2 shows 10. You can also subtract raw numbers, such as =1500-1000, but referencing cells is better because the result updates automatically when the source data changes.

Worked example: month-over-month sales

MonthSalesDifference formulaResult
January1000
February1500=B3-B2500

Here =B3-B2 returns 500, meaning sales rose by $500. A positive result is an increase; a negative result is a decrease. If you would rather build the calculation visually, see how to subtract in Excel and the dedicated subtraction formula walkthrough.

Calculate the difference down a whole column

You rarely subtract just one pair of numbers. To apply the same formula to every row:

  1. Enter =A2-B2 in the first result cell.
  2. Select that cell and hover over the small square in its bottom-right corner — the fill handle.
  3. Double-click the fill handle, or click and drag it down the column.

Excel copies the formula and adjusts the cell references automatically (row 3 becomes =A3-B3, and so on). This relative referencing is the default behavior. For a deeper look, read how to use the fill handle. When you need the same calculation across paired columns instead of within a row, see subtracting two columns in Excel and subtracting multiple cells.

Method 2: The absolute difference with ABS

Sometimes the direction of the change does not matter — you only care how far apart two numbers are. The ABS function strips the minus sign and always returns a positive number.

=ABS(A2-B2)

If A2 is 35 and B2 is 40, plain subtraction gives -5, but =ABS(35-40) returns 5. This is ideal for measuring gaps, variances, or tolerances where a “5 below” and “5 above” should count the same. If you only want to flip an existing negative result to positive, turn a negative number positive covers the alternatives.

When to use ABS

  • Comparing forecast versus actual where over- and under-shoots are equally important.
  • Quality-control tolerances (how far from a target measurement).
  • Distance-style comparisons between any two readings.

Method 3: Percentage difference and percentage change

A raw difference of 500 means little without context — is that a big jump or a rounding blip? Percentage change shows the size of the move relative to the starting value.

Percentage change formula:

=(new_value - old_value) / old_value

Format the result cell as a percentage (select it and press Ctrl + Shift + % on Windows, or Control + Shift + % on Mac) so Excel displays 100% instead of 1. If your subscribers grew from 1000 to 2000, =(B3-B2)/B2 returns 100%.

If you prefer to keep the value as a plain number, multiply by 100 instead: =((2000-1000)/1000)*100.

Percentage change vs. percentage difference: Percentage change compares a new value against a specific starting (old) value. Percentage difference compares two values against their average: =ABS(A2-B2)/AVERAGE(A2:B2). Use percentage change for “before and after” data; use percentage difference when neither value is the baseline.

For full walkthroughs, see calculate percentage change and calculate percentage difference.

Calculate the difference between dates

Excel stores every date as a serial number (the count of days since January 1, 1900). Because dates are numbers under the hood, you can subtract them directly:

=B2-A2

If A2 is 1/1/2026 and B2 is 1/15/2026, the formula returns 14 — the number of days between them. If the result shows up as a date instead of a number, change the cell format to General or Number.

For more control, use the DATEDIF function, which returns the difference in days, complete months, or complete years:

=DATEDIF(A2, B2, "d")   → days
=DATEDIF(A2, B2, "m")   → whole months
=DATEDIF(A2, B2, "y")   → whole years

The start date must be earlier than the end date or DATEDIF returns an error. Learn more in the DATEDIF function guide and the broader tutorial on calculating days between dates.

Calculate the difference between times

Time works the same way — Excel stores times as fractions of a day (noon is 0.5). Subtract the earlier time from the later time:

=B2-A2

Format the result cell as Time (h:mm) for an elapsed duration, or as a number to get a decimal portion of a day. To display totals that exceed 24 hours (such as cumulative project time), apply the custom format [h]:mm — the square brackets stop the hours from rolling over at midnight. The full method is in calculate time difference in Excel.

Keyboard shortcuts and Windows vs. Mac

Most subtraction work is typing, but a few shortcuts speed things up. The keys differ between platforms:

ActionWindowsMac
Confirm a formulaEnterReturn
Edit the active cellF2Control + U
Format selection as percentageCtrl + Shift + %Control + Shift + %
Insert AutoSumAlt + =Command + Shift + T
Copy / Paste formulaCtrl + C / Ctrl + VCommand + C / Command + V
Show formulas instead of resultsCtrl + ` (grave accent)Control + `

The formulas themselves (=A2-B2, ABS, DATEDIF) are identical on Windows and Mac — only the surrounding keyboard shortcuts change. If you are on a Mac and a shortcut behaves oddly, double-check your version is current with how to update Excel on Mac.

Troubleshooting common difference errors

A few predictable problems account for most “my subtraction isn’t working” complaints:

  • The formula shows as text (you see =A2-B2 literally). The cell is formatted as Text. Set it to General, then re-enter the formula. This is the single most common cause.
  • #VALUE! error. One of your cells contains text, a space, or a non-numeric character. Clean the data so both cells hold real numbers or real dates.
  • You forgot the equals sign. Every calculation must start with =. Without it, Excel treats the entry as plain text.
  • Mixing incompatible types. Subtracting a date from a number (or vice versa) gives a nonsensical result. Make sure both operands are the same type.
  • Wrong sign on the answer. If increases show as negatives, you subtracted in the wrong order — swap to =new-old, or wrap the formula in ABS if direction doesn’t matter.

Highlight negative differences automatically

To flag every decrease in red, select your results column, open Conditional Formatting → Highlight Cell Rules → Less Than, enter 0, and choose a red fill. Now any negative difference stands out at a glance. Step-by-step instructions are in how to use conditional formatting.

Subtracting one cell from many at once

If you need to subtract a single fixed cell (say a budget figure in B1) from a whole column, lock that reference with dollar signs so it does not shift as you fill down:

=A2-$B$1

The $B$1 stays anchored while A2 advances to A3, A4, and so on. For more on this technique, see subtracting cells in Excel. And if you also need running totals alongside your differences, adding a sum in Excel pairs well with this layout.

Frequently Asked Questions

How do I calculate the difference between two numbers in Excel?

Type =A2-B2 in an empty cell, replacing A2 and B2 with the cells holding your two numbers, then press Enter. Put the larger value first for a positive result, or wrap the formula in =ABS(A2-B2) to always get a positive difference regardless of order.

How do I subtract in Excel?

Excel subtracts with the minus sign inside a formula — there is no SUBTRACT function. Start with =, then enter the cell or number you are subtracting from, a -, and the value to subtract: for example =C5-D5 or =200-50. Press Enter to see the result.

How do I find the percentage difference between two numbers?

For percentage change from an old value to a new one, use =(new-old)/old and format the cell as a percentage. For percentage difference against the average of the two, use =ABS(A2-B2)/AVERAGE(A2:B2). Choose change when one number is the clear starting point and difference when neither is.

Why does my Excel difference formula show the formula instead of the answer?

The result cell is formatted as Text, so Excel displays your formula literally instead of calculating it. Select the cell, set its format to General (Home tab → Number group), then press F2 and Enter to re-enter the formula. Also confirm Show Formulas (Ctrl + `) is turned off.

Can I calculate the difference between two dates or times?

Yes. Subtract the earlier date from the later date with =B2-A2 to get the number of days, or use =DATEDIF(A2,B2,"d") for days, "m" for months, or "y" for years. For times, subtract the same way and format the result as h:mm, or [h]:mm for durations longer than 24 hours.

How do I subtract the same number from a whole column?

Lock the fixed value with dollar signs and fill the formula down. Enter =A2-$B$1 in the first cell (where B1 is the number to subtract from every row), then double-click the fill handle. The $B$1 stays anchored while the other reference adjusts for each row.

Conclusion

Calculating differences in Excel comes down to one core idea — subtraction with =A2-B2 — plus a handful of refinements: ABS for absolute gaps, (new-old)/old for percentage change, and direct subtraction or DATEDIF for dates and times. Match the method to your question, keep your cells formatted as numbers, and use the fill handle to scale a single formula across thousands of rows in seconds.

Related guides

How To

How to Find Difference in Excel

Learn how to find the difference in Excel between two values or two columns using simple formulas and functions, such as MINUS and IFERROR. Perfect for analyzing data sets!

May 20, 2023

View all Basic Excel Operations guides →