Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Do a Diff in Excel: Compare Two Sheets Fast

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Excel has no built-in "diff" button, but you can compare two versions of a workbook quickly using one of three reliable methods: the Spreadsheet Compare tool that ships with some Microsoft 365 and Office Professional Plus editions, a formula-based comparison using IF or EXACT on a side-by-side copy of the sheets, or Excel's own Inquire add-in if it is available on your installation. The formula method works in every version of Excel, including Excel for the web, Mac and any desktop build, which is why it is the one worth learning first. The ideas below use the standard Excel ribbon; exact menu labels can differ slightly by version, edition and region.

What You'll Need

  • Both versions of the file saved somewhere you can open them, ideally with distinct names such as Budget_v1.xlsx and Budget_v2.xlsx.
  • Excel on Windows or Mac. Some steps (Spreadsheet Compare, Inquire) are Windows-only or tied to specific editions and will not appear on Mac or the web.
  • A decision on what counts as a difference: values only, or also formatting, formulas and hidden rows.
  • A copy of the file before you start editing, so the comparison itself never destroys the original.

Step-by-Step

Method 1: Compare with a formula (works everywhere)

  1. Open the newer workbook and add a new blank worksheet, for example named Compare.
  2. In A1 of the new sheet, type an equals sign and click the corresponding cell in the old workbook's first sheet, then press Enter. Delete the workbook name if it bothers you; the formula will still point to the other file.
  3. Copy that reference across the used range so the new sheet mirrors the old sheet cell for cell. Use Ctrl+C, select the same block, then paste, or drag the fill handle.
  4. On the new workbook's original sheet, put your comparison formula in the first empty column of row 1. A simple value check is =IF(A2<>Compare!A2,"DIFF",""). For case-sensitive text comparison use =IF(EXACT(A2,Compare!A2),"","DIFF").
  5. Press Enter, then copy the formula down the whole column and across any other columns you are comparing. Every row that differs now shows the word DIFF.
  6. Turn on a filter on that column (Data > Filter) and filter for DIFF to see only the changed rows.
  7. To count differences without reading each one, add =COUNTIF(G:G,"DIFF") in a spare cell, where G is your comparison column.
  8. Save this as a separate working copy so the comparison formulas never end up in the file you send to anyone else.

Method 2: Use Spreadsheet Compare (Windows, certain editions)

  1. Search the Start menu for Spreadsheet Compare. If it does not appear, your edition does not include it, and that is normal, not a fault. Use Method 1 instead.
  2. Open the tool and choose the two files with the Compare command. Pick the older file first, then the newer one.
  3. Set which change types matter by ticking categories such as entered values, calculated values, formulas, formatting and macros.
  4. Run the comparison. The tool shows a grid of both sheets and colour-codes the differences, plus a pane listing each change with the cell reference, old value and new value.
  5. Export the results with the Export button if you need to share a record of what changed.

Method 3: Compare side by side inside one workbook

  1. Open the workbook and go to View > New Window. This opens a second view of the same file.
  2. In one window, switch to the old sheet; in the other, the new sheet.
  3. Choose View > Arrange All and pick Vertical or Horizontal, then tick Syncronous Scrolling (Excel spells it with one "h").
  4. Scroll and compare visually. This is useful for spotting formatting and layout differences that formulas cannot see, but it is not reliable for large sheets, so combine it with the formula method.

Common Mistakes

  • Comparing whole ranges when only a few rows matter. Narrow the comparison columns so the DIFF column stays readable.
  • Forgetting that numbers stored as text (left-aligned, often with a green triangle) will not match real numbers, producing false diffs. Convert one side with Value or paste values.
  • Leaving trailing spaces in either sheet. A space at the end of a name makes a cell look identical but compare as different; use TRIM around your values.
  • Comparing formulas instead of results, or the other way round, without deciding which you want. Two cells can show the same result while one is hard-typed and the other calculated.
  • Editing the original file during the comparison, which silently changes the reference and makes both sides match.
  • Ignoring hidden rows and filtered-out data, which can hide real changes. Clear filters and unhide before you start.
  • Assuming dates and times match because they look the same. They may differ by seconds and display rounded. Compare with a tolerance.

Tips

  • Thicken the comparison to return the actual values rather than just a flag: =IF(A2<>B2,"Old: "&A2&" / New: "&B2,"") gives you a readable audit trail.
  • Use IFERROR around references to the other workbook so a renamed or closed file does not flood the sheet with #REF!.
  • Add conditional formatting on the DIFF column to colour the whole row, which makes scanning long lists much faster.
  • For structural checks (which rows exist in one file but not the other), build a key column in both sheets and use COUNTIF or MATCH against the other sheet's key rather than comparing row by row.
  • Sort both sheets by the same key before comparing. Unsorted copies shift rows and produce diffs everywhere.
  • Keep the comparison sheet in a separate file so your final workbook stays clean.

Troubleshooting

Every row shows as different. The sheets are almost certainly out of alignment. Check that the first compared cell really refers to the matching cell on the other sheet, and that neither sheet has an extra header row or blank row inserted.

The comparison formulas show errors after you reopen the file. Formulas that point to the other workbook break when that file is closed, moved or renamed. Open the linked file first, then recalculate with F9, or paste the old sheet as values into the comparison workbook before comparing.

Cells look identical but still flag as different. Inspect with =LEN() on both sides to catch hidden spaces, and with =ISNUMBER() to check whether one side is text and the other is a number.

Spreadsheet Compare is missing. It is not part of every Excel edition, particularly on Mac and Excel for the web. There is no unofficial download that provides it safely, so use the formula method instead.

The workbook is very large and slow. Limit the comparison to the used range, remove whole-column references, and set calculation to manual while you build the formulas, then switch back.

If that did not work, save a copy, close and reopen Excel, and confirm both files open cleanly on their own. A damaged file often shows comparison errors that disappear once the file is repaired with Open and Repair from the File > Open dialog.

Frequently Asked Questions

Does Excel have a built-in compare tool?

Not a general one on every edition. Spreadsheet Compare exists in some Windows editions, and the Inquire add-in is available on certain builds. For universal coverage, use formulas.

How do I compare two whole workbooks?

Compare sheet by sheet. Open both files, put them side by side, and build a mirrored copy of each sheet plus a DIFF column. Comparing the entire workbook in one step is only possible with Spreadsheet Compare where it is installed.

Can I highlight differences instead of using a formula?

Yes. Select the new range, open Home > Conditional Formatting > New Rule > Use a formula, and enter a formula such as =A2<>Compare!A2 with a fill colour. Differences then light up without extra columns.

Why do my numbers differ when they look the same?

Decimal precision, rounding, or one value being stored as text. Use =ROUND(A2,2)<>ROUND(B2,2) or convert the text to numbers first.

Does this work in Excel for the web or on Mac?

The formula and conditional formatting methods work. Spreadsheet Compare does not run on Mac or in the browser, and Inquire is not available on Mac.