To find the signed difference between two numbers in Excel, subtract one cell from the other, such as =A2-B2. To return the difference as a positive number regardless of which value is larger, use =ABS(A2-B2); Excel has no separate function named DIFFERENCE.
Subtraction or absolute difference?
The best formula depends on what “difference” means in your task. Ordinary subtraction preserves direction: the result is positive when the first value is greater, negative when it is smaller, and zero when the values match. That makes it useful for tracking increases and decreases, balances, and variances.
For example, with the first number in A2 and the second number in B2, enter =A2-B2 in C2. If A2 contains 125 and B2 contains 98, C2 returns 27. If A2 contains 98 and B2 contains 125, it returns -27. The order matters: subtraction is not interchangeable, so decide which number is the starting or comparison value.
Use ABS when you only care about the size of the gap, not which value is larger. With 98 in A2 and 125 in B2, =ABS(A2-B2) returns 27 rather than -27. ABS means absolute value: it changes a negative result to its positive equivalent and leaves positive values and zero unchanged.
- Use subtraction when the sign tells you whether a value rose or fell.
- Use ABS when you want a nonnegative gap, such as the distance between two measurements.
- Use a percentage-change calculation when the question is how large the change is relative to a starting value.
Build a reusable difference column
A common layout puts the original value in column A, the new value in column B, and the calculated difference in column C. Put labels such as “Original,” “New,” and “Difference” in row 1, then enter the calculation in C2. With the original value in A2 and the new value in B2, use =B2-A2. If A2 is 80 and B2 is 93, the result is 13, showing an increase of 13 units.
That formula is deliberately ordered as new minus original. A positive result then represents an increase, while a negative result represents a decrease. If the new value were 72 instead, the result would be -8. You can copy the formula down for more rows: select C2 and drag the small square at its lower-right corner, or copy C2 and paste into the cells below. Excel adjusts the row references automatically, so the next row calculates using A3 and B3.
Keep the values in separate cells rather than typing them directly into a formula when you expect to update the data. A cell-reference formula recalculates when either input changes, and one formula can be filled through a long list. If your values are not in columns A and B, replace those references with the cells that contain your numbers.
Calculate percentage difference from a baseline
A raw difference gives a number of units, not the relative size of a change. If a price rises by $10, that is a 20% increase from $50 but only a 2% increase from $500. For a change relative to an earlier or baseline value, divide the change by that baseline.
Assume the old value is in A2 and the new value is in B2. Enter =(B2-A2)/A2. With A2 equal to 80 and B2 equal to 100, the result is 0.25, or 25%. Apply the Percentage format to the result cell using Home > Number > Percent Style; Excel then displays 25% rather than 0.25. The calculation is often called percentage change or percent increase/decrease.
The denominator must be the baseline you intend to compare against. Reversing the values changes the meaning and can change the percentage substantially. For example, moving from 100 to 80 is a 20% decrease, because the decrease of 20 is divided by the starting value of 100. The percentage change from 80 back to 100 is 25%, because the increase of 20 is divided by 80.
If the baseline is zero, ordinary percentage change is undefined because division by zero is not possible. If you want the worksheet to show a label instead of an Excel error, and the old value is in A2 while the new value is in B2, use =IF(A2=0,"N/A",(B2-A2)/A2). This returns N/A when A2 is zero; otherwise it calculates the percentage change. Choose a label that fits your report, and do not interpret a change from zero as a conventional percentage increase.
Check whether two values are different
Sometimes you do not need the size of the difference; you only need to know whether two entries match. With the values in A2 and B2, enter =A2<>B2. Excel returns TRUE if they differ and FALSE if they are equal. The operator <> means “not equal to.” This can be useful in an audit column or as the basis for a later IF formula.
For a direct comparison, the result is based on the stored values, not necessarily what rounded cells appear to show. For example, two cells might both display 1.23 while storing slightly different decimal values. If the intended comparison is to two decimal places, round the values for the comparison. With the values in A2 and B2, enter =ROUND(A2,2)<>ROUND(B2,2). This checks whether their rounded values differ, rather than whether the underlying values differ at any precision.
Find the number of days between dates
Excel stores dates as serial numbers, so subtracting one date from another returns the number of elapsed days. If the earlier date is in A2 and the later date is in B2, enter =B2-A2. For January 1, 2026 in A2 and January 10, 2026 in B2, the result is 9 days. The count is elapsed days, not an inclusive count of both calendar dates.
If the result looks like another date instead of a day count, change the result cell’s number format to General or Number. On Windows, select the cell and choose Home > Number Format > General (or Number). If you need working days rather than all calendar days, subtraction is not sufficient because it includes weekends and holidays. Excel provides NETWORKDAYS for a workday count; check its start-date, end-date, and optional holiday-list arguments before using it for a particular schedule.
Dates that Excel recognizes as text may not subtract correctly. If a date is left-aligned or does not respond to date formatting as expected, check whether it was imported as text. Convert it to a real Excel date before calculating, and confirm that the workbook’s regional date interpretation matches the input, especially for ambiguous entries such as 03/04/2026.
Choose number formatting and rounding carefully
Formatting changes how a result appears, not the underlying calculation. A difference of 0.5 can display as 1 when rounded to zero decimal places, even though the stored result is still 0.5. Increase the displayed decimal places if the detail matters, or use ROUND in a formula when the calculation itself should use a fixed number of decimal places.
For instance, with values in A2 and B2, =ROUND(A2-B2,2) calculates their difference and rounds the result to two decimal places. If A2 is 10.125 and B2 is 3, the subtraction is 7.125 and the rounded result is 7.13. Use rounding because the business rule requires it—not just to make cells look tidy. In financial work, premature rounding can make a total differ from the sum of displayed line items.
Also check the units. Subtracting 5 kilograms from 8 kilograms gives a meaningful difference of 3 kilograms; subtracting 5 kilograms from 8 meters does not. Excel generally treats both as numbers and will not warn you about incompatible units. A clear column heading, such as “Difference (kg),” helps prevent a mathematically valid but misleading result.
Fix common formula problems
If a difference formula displays an error or an unexpected result, check the inputs before changing the formula. The most common causes are text values that look like numbers, a reversed subtraction order, blank cells, and formatting that hides the actual result.
- Negative result: This is normal when the first operand is smaller. Reverse the order only if the comparison should run from the other direction; use ABS only if direction does not matter.
- #VALUE!: One or both cells may contain text that Excel cannot use in arithmetic, such as a number imported with an unexpected character. Inspect the cell contents and convert valid numeric text to numbers.
- #DIV/0!: This commonly occurs in percentage change when the baseline is zero. Decide how a zero baseline should be reported rather than treating the error as a meaningful percentage.
- Unexpected zero: Check whether the cells are genuinely equal, whether a blank is being treated as zero in the calculation, and whether the displayed decimals are hiding a small difference.
- Formula appears as text: The cell may be formatted as Text, or the entry may have a leading apostrophe. Change the cell to General, then re-enter the formula.
When results seem inconsistent, click the result cell and inspect the formula bar. Confirm the referenced cells, the order of subtraction, and whether the input values are numeric. A quick check is to temporarily display more decimal places or compare the inputs directly. These checks help distinguish a formula issue from a data or display issue.
Which method should you use?
Start by translating the question into a sentence. “How much higher is the new value?” calls for new minus old, because the sign communicates direction. “How far apart are these measurements?” calls for an absolute difference. “What percentage did it change?” calls for the change divided by the starting value. “Do these two entries match?” calls for a comparison that returns TRUE or FALSE.
For a simple two-number calculation, the subtraction operator is usually clearest; there is no need to search for a special difference function. Add ABS, ROUND, or a zero check only when the result needs that specific behavior. Keeping the formula simple makes it easier to review, fill down, and explain to someone else.
Frequently Asked Questions
What is the Excel function for the difference between two numbers?
Excel does not have a built-in function named DIFFERENCE for ordinary subtraction. Use the minus operator, such as =A2-B2, to subtract one cell from another. Use ABS around the subtraction if you want a nonnegative gap.
How do I subtract one number from another in Excel?
Click the cell where you want the answer, type an equals sign, select or type the first cell reference, enter a minus sign, and select or type the second reference. For example, with the numbers in A2 and B2, enter =A2-B2 and press Enter.
How do I make the difference positive?
Wrap the subtraction in ABS. With the numbers in A2 and B2, =ABS(A2-B2) returns the distance between them without a negative sign, regardless of which one is larger.
How do I calculate percentage difference in Excel?
For percentage change from an old value to a new one, subtract old from new and divide by old. With old in A2 and new in B2, use =(B2-A2)/A2, then format the result as a percentage. A zero old value needs a separate rule because division by zero is undefined.
Why does my difference show as a date?
The result cell may be formatted as Date. Select it and change its number format to General or Number. This is especially common when subtracting dates, because Excel can display the resulting day count using the cell’s existing date format.
Related
- Pull Data Dumps With No Blank Rows in Excel
- Excel Subtotal Rows in Color: How to Highlight Them
- How to Delete Subtotal Rows in Excel Without Losing Data
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- How to Copy a Formula in Excel to Other Cells SafelyTo copy a formula in Excel, select the cell that contains it, then drag its fill handle into…
- Excel Date Difference in Years: Formulas That WorkTo find the number of complete years between two dates in Excel, use =DATEDIF(A2,B2,"Y"), with the earlier date…
- Calculate Age in Weeks in Excel with a Simple FormulaTo calculate completed age in weeks in Excel, put a birth date in A2 and enter =INT((TODAY()-A2)/7) in…
- Concat Excel Cell Range: Join Cells With Simple FormulasWith the values to join in A2:A5, enter =CONCAT(A2:A5) to combine the range into one text string; for…
- Power Query VLOOKUP: Match Data From Another TableYes. In Excel for Microsoft 365, Power Query can look up values in another table by merging the…
- VLOOKUP Examples in Excel: Formulas That WorkVLOOKUP finds a value in the first column of a range and returns a value from another column…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.