Difference Between Numbers in Excel: Formulas & Uses

Formulas & functions · Updated November 19, 2026

To find the difference between two numbers in Excel, subtract the second cell from the first: with the first number in A2 and the second in B2, enter =A2-B2. For a difference that is always positive, regardless of which number is larger, use =ABS(A2-B2).

Subtract One Number from Another

Excel uses the minus sign for subtraction. If A2 contains 125 and B2 contains 98, the formula =A2-B2 returns 27. If you reverse the cell references, =B2-A2 returns -27. The sign is meaningful: it tells you whether the first value is greater or less than the second.

To enter the calculation, select an empty cell, type an equals sign followed by the cell references and minus sign, then press Enter. Excel displays the result in the formula cell. If the input numbers change later, the result updates automatically. For a row of comparisons, enter the formula in the first result row and use the fill handle—the small square at the lower-right corner of the selected cell—to copy it down. Excel adjusts relative references as the formula moves.

For example, if A2:A6 lists budget amounts and B2:B6 lists actual amounts, enter the difference formula in C2 and copy it through C6. A positive result means the budget amount in column A exceeds the actual amount in column B; a negative result means the reverse. Decide what the columns represent before interpreting the signs.

Show the Absolute Difference

Sometimes the size of the gap matters, but its direction does not. The ABS function returns the absolute value, changing a negative result to a positive one while leaving a positive result unchanged. With values in A2 and B2, =ABS(A2-B2) returns 27 whether A2 is 125 and B2 is 98 or the values are reversed.

This is useful for questions such as how far two measurements are apart or whether two prices differ by more than a set amount. It is not the right choice when you need to know which value is higher. For that, use ordinary subtraction and keep the sign. An absolute difference also does not express the gap as a percentage; a difference of 10 has a very different significance when comparing 20 with 30 than when comparing 1,000 with 1,010.

Calculate a Percentage Change

A percentage change describes how much a value has risen or fallen relative to its starting value. The order matters: divide the change by the original value. If A2 contains an original value of 80 and B2 contains a new value of 100, enter =(B2-A2)/A2 in C2. The result is 0.25, which displays as 25% when C2 is formatted as a percentage.

If the new value is 60 instead, the formula returns -0.25, or -25%. That negative sign indicates a decrease. To format the result, select the cell and choose Home > Number > Percent Style. You can adjust the number of displayed decimal places using the increase or decrease decimal controls in the Number group. Formatting changes how a value appears, not the underlying calculation.

Use a consistent definition of “change.” In a before-and-after comparison, the earlier amount is normally the starting value. If the starting value is zero, percentage change is undefined because division by zero is not possible; Excel returns a #DIV/0! error. A percentage change can also be difficult to interpret when the starting value is very small, because even a modest numerical change may produce a large percentage.

Percentage Change Versus Percentage Difference

These terms are sometimes used interchangeably, but they can describe different calculations. Percentage change is directional: it compares a new value with a designated starting value. Percentage difference is often used for a symmetric comparison when neither value is considered the original. State which definition you use when sharing a report, since the two results need not match.

For a symmetric comparison of two positive values, use the absolute gap divided by their average. With the values in A2 and B2, enter =ABS(A2-B2)/AVERAGE(A2,B2). If A2 is 80 and B2 is 100, the absolute gap is 20 and the average is 90, so the result is about 22.22%. Format the result as a percentage. This is not the same as the 25% increase from 80 to 100, because that calculation uses 80—not the average—as its reference.

Choose the calculation based on the question, not just the label. Use percentage change to report growth or decline from a baseline, such as monthly sales compared with the previous month. Use percentage difference when comparing two values on equal footing, such as measurements from two methods. When either value can be zero or negative, check whether the chosen percentage definition remains meaningful for the data.

Compare Two Numbers for Equality

If the question is whether two cells match rather than how far apart they are, use an equality test. With the values in A2 and B2, enter =IF(A2=B2,"Same","Different"). Excel returns “Same” when the numeric values are equal and “Different” otherwise. For a direct TRUE or FALSE result, enter =A2=B2.

Equality compares the stored values, not necessarily the way they look on screen. For example, 5 and 5.00 are equal as numbers even if one cell is formatted to show no decimal places and the other shows two. A displayed value may also be rounded while the stored value contains additional decimal places. If an imported dataset contains tiny floating-point differences, decide on an appropriate rounding rule before comparing; do not assume that matching displayed digits always mean the stored values are identical.

Find the Difference Across a List

For a list of values, “the difference” might mean the spread between the largest and smallest number rather than the change between neighboring rows. With values in A2:A10, enter =MAX(A2:A10)-MIN(A2:A10). MAX returns the largest value and MIN returns the smallest, so the formula gives the range. If the largest value is 42 and the smallest is 15, the result is 27.

This range is a quick measure of spread, but it does not show how values are distributed between the extremes. A list with most values clustered near 20 and one value at 42 can have the same range as a more evenly spread list. If you need row-by-row changes instead, subtract adjacent entries—for example, compare A3 with A2 in a result cell on row 3, then fill the formula down. Label the result column clearly so readers know which type of difference it represents.

Differences Between Dates and Times

Excel stores dates as serial numbers, so subtracting one date from another gives the number of days between them. With a start date in A2 and an end date in B2, enter =B2-A2. If the dates are 1 March and 6 March of the same year, the result is 5 days. The order still matters: an end date earlier than the start date produces a negative result.

Time values can be subtracted too. With a start time in A2 and an end time in B2, =B2-A2 returns a fraction of a day. Format the result as a time duration, or multiply by 24 to express it in hours. If the shift crosses midnight, a simple subtraction may return a negative value; account for the date or use a calculation appropriate to the schedule rather than treating the times as if they were on the same day. Also check the result cell’s number format: a valid date or time calculation can look confusing when displayed in a general or date format.

Common Problems and How to Fix Them

  • The result is negative. This is expected when the number being subtracted is larger. Reverse the references only if the comparison’s direction should also reverse; use ABS if direction is irrelevant.
  • The formula appears as text. The cell may be formatted as Text, or the entry may begin with an apostrophe. Change the cell format to General, then re-enter the formula so Excel calculates it.
  • The result is zero when values look different. The cells may contain equal numeric values with different number formats. Check the stored values and decimal precision, not only their displayed appearance.
  • You see #VALUE!. One or both cells may contain text that Excel cannot use in arithmetic. Imported numbers sometimes arrive as text; check the cell contents and convert them to numeric values before subtracting.
  • You see #######. This usually means the column is too narrow to show the formatted value, especially for dates or times. Widen the column or choose a suitable number format.
  • A copied formula uses the wrong cells. Relative references change when a formula is filled down or across. Review the references in the copied cell and, when a reference must remain fixed, use dollar signs such as $A$2.

Choose the Right Calculation

Before writing a formula, identify the question you are answering. A directional subtraction tells you which number is larger; ABS gives the magnitude of the gap; percentage change measures movement from a baseline; percentage difference compares two values symmetrically; and MAX minus MIN gives the spread of a list. These calculations can all be called a “difference” in casual conversation, but they answer distinct questions.

For a clear worksheet, put the compared values in labeled columns, use a descriptive heading for the result, and make units visible. A result of 27 could mean dollars, items, points, or days. If the data will be reviewed by someone else, add a note such as “actual minus budget” or “percent change from prior month.” That small clarification prevents a correct formula from being interpreted backward or mistaken for a different measure.

Frequently Asked Questions

What is the simplest formula to find the difference between two cells in Excel?
Subtract one reference from the other, such as =A2-B2. The result can be negative, depending on which cell has the larger value.

How do I get a positive difference in Excel?
Wrap the subtraction in ABS: =ABS(A2-B2). This returns the size of the gap without indicating which number is larger.

How do I calculate the percentage difference between two numbers?
First decide whether you mean change from a starting value or a symmetric comparison. For change, subtract the original from the new value and divide by the original. For a symmetric comparison of positive values, divide the absolute gap by their average.

Why does my percentage formula show a decimal?
A percentage is stored as a decimal fraction, so 0.25 represents 25%. Apply Percent Style from Home > Number to display it as a percentage.

Can Excel calculate the difference between dates?
Yes. Subtract the earlier date from the later date to return elapsed days. Confirm that both cells contain valid Excel dates and that the result cell is formatted to display the intended value.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.