How to Diff Excel Spreadsheets: Step-by-Step Guide
In this article
To diff two Excel spreadsheets, the quickest reliable method is to keep both files open side by side and use Excel's built-in comparison tools: View > Side by Side and View > Synchronous Scrolling for a visual check, Ctrl + \ or F5 > Special > Row differences to highlight differing cells row by row, or conditional formatting with a cross-sheet formula to mark every mismatch in colour. For whole-workbook checks (formulas, links, formatting), use Excel's Inquire add-in or a formula-based comparison column. Which method fits depends on whether you are comparing two versions of the same file, two different files, or two sheets inside one workbook. Menu labels can differ slightly by Excel version, platform and region, so treat the paths below as a guide.
What You'll Need
- Microsoft Excel on Windows or Mac (the desktop app, not just Excel for the web, since several methods below rely on desktop features). Excel for the web can still use side-by-side windows and formulas, but not the Inquire add-in.
- Both workbooks saved and closed to any other user, so no cell is mid-edit.
- A backup copy of each file before you start changing anything. Comparing by formula or conditional formatting means adding helper columns or rules, which you will want to undo cleanly.
- Matching column headers and a clear idea of the key column (an ID, SKU or email) that should exist in both files. Differences on a key column make row matching unreliable.
- Optionally, the Inquire add-in enabled under File > Options > Add-ins if you want a workbook-level comparison. It is normally available in Microsoft 365 and Office Professional Plus builds, not in every edition.
Step-by-Step
Method 1: Side-by-side visual comparison
- Open both workbooks in Excel.
- On the View tab, click View Side by Side. Excel tiles the two windows. If more than two workbooks are open, a dialog asks you to pick the one to compare with.
- On the same tab, click Synchronous Scrolling so both sheets scroll together. If the windows are different sizes, also turn on Reset Window Position so the view stays aligned.
- Move through the sheets and watch for cells that differ. This works best on small sheets or when you only need to confirm a handful of numbers.
Method 2: Highlight row differences on one sheet
- Copy the two sheets you want to compare into one workbook, each on its own tab. Name them clearly, for example Old and New.
- Make sure both sheets have the same column order and the same starting row.
- On the New sheet, select the data range that corresponds to the Old sheet, including the first column.
- Press F5 (or Ctrl + G), click Special, choose Row differences, and click OK. Excel selects the cells that differ from the first column in each row, so set your comparison column correctly.
- Apply a fill colour to the selected cells with the Home tab so you can review them one by one.
Method 3: A comparison column with formulas
- Put both datasets in the same workbook, with a shared key column.
- In a helper sheet, list the keys from one file. Next to each key, use a lookup such as XLOOKUP or VLOOKUP to pull the matching row from the other file.
- Add a column with a formula like
=IF(A2=B2,"Match","Different")for each field you want to check, or combine several checks with&andIFso one column flags any mismatch in the row. - Filter the result column for "Different" to see every changed record together. This is the most reliable method for large sheets, because it produces an auditable list rather than a colour you have to hunt for.
- Wrap the lookup in IFERROR so keys that exist in one file but not the other show clearly, for example as "Missing" instead of an error.
Method 4: Conditional formatting across two sheets
- Select the range in the sheet you want highlighted.
- Go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format.
- Write a rule that compares the cell to its counterpart on the other sheet, for example
=$A2<>Old!$A2, adjusting the sheet name and anchoring to match your layout. - Pick a fill colour and apply. Every mismatched cell is now shaded and updates as the data changes.
Method 5: Compare two workbooks with Inquire
- Enable the add-in under File > Options > Add-ins, set the manage list to Excel Add-ins, then tick Inquire.
- Open both workbooks.
- On the Inquire tab, click Compare Files, choose the two files, and set which one is the "compare" and which the "to" file.
- Review the report, which lists cell-level differences, formulas and changed formatting in the spreadsheet comparison pane. Availability varies by edition and version, so if the tab is missing, use one of the formula methods instead.
Common Mistakes
- Comparing sheets with different layouts. If a column was inserted or rows are sorted differently, side-by-side and row-difference methods will report changes that are not real. Align the structure first.
- Ignoring hidden rows, filters and trailing spaces. A cell that looks identical may differ by a space or a number stored as text. Trim values before comparing.
- Comparing displayed values only. Two cells can show the same number but hold different formulas, or different numbers rounded for display. Widen columns or check the formula bar before declaring a match.
- Forgetting dates and numbers format. A date in one file and text in another will always look different. Check number format as well as value.
- Editing the live files. Helper columns and formatting rules left in place can end up in a shared file. Work on copies.
- Relying on colour alone for big sheets. On hundreds of rows, a formula-driven list is far easier to verify than scattered highlights.
Tips
- Sort both datasets by the same key before comparing. Sorted data makes row-by-row checks meaningful.
- Use Go To Special to find blanks and constants quickly when a comparison flags an unexpected cell.
- For recurring comparisons, save a template with the lookup and match formulas already built. Future checks then become a paste-and-refresh job.
- Compare one sheet at a time rather than whole workbooks. Whole-workbook diffs are noisy because formatting and defined names change constantly.
- If you only need to spot changes in a single column, conditional formatting is faster to set up than a formula table.
- Keep a copy of the original files until you have finished reviewing every flagged row.
Troubleshooting
Side by side will not align. Close extra workbooks so only two are open, then re-apply View Side by Side and Synchronous Scrolling. Maximised windows sometimes refuse to tile; restore them to windowed size first.
Row differences selects the wrong cells. The feature compares each row to the first column of your selection. Include the correct reference column, or use a formula comparison instead.
Lookups return errors on values that look the same. One side is probably text and the other a number, or there are leading spaces. Use TRIM and VALUE (or multiply by 1) to normalise, then re-run the lookup.
The Inquire tab is missing. The add-in is not available in every Excel edition and may need enabling, and it is not part of Excel for the web or mobile apps. Fall back to Method 3 or 4, which work everywhere.
Conditional formatting highlights everything. The rule references are usually off by a row or the sheet name is wrong. Check the absolute and relative references in the formula.
Formulas point to the wrong workbook. When you copy sheets between files, external links can follow. Use Data > Edit Links to see and break links you no longer need before comparing.
If that did not work, export both sheets to CSV and run a text diff tool outside Excel. It ignores formatting and shows only data changes, which is often exactly what you want.
Frequently Asked Questions
Can I compare two Excel files without opening both?
Not with Excel's own tools. Side-by-side, Inquire and conditional formatting all need the workbooks open in the desktop app. Excel for the web can open two tabs for a visual check but lacks the Inquire add-in.
Does Excel have a built-in compare feature?
Partly. The Inquire add-in includes Compare Files for workbook-level differences, but it is not available in every edition. For most people, formula columns and conditional formatting are the everyday method.
How do I compare two sheets in the same workbook?
Put them on separate tabs with matching layout, then use a lookup formula or conditional formatting rule that references the other tab, such as =$A2<>Old!$A2.
Can I compare Excel files on a Mac?
Yes for side-by-side viewing, formulas and conditional formatting. The Inquire add-in is more limited on Mac, so the formula-based comparison is the dependable choice there.
Why do identical looking cells show as different?
Hidden characters, trailing spaces, numbers stored as text, or different date formats. Normalise values with TRIM and VALUE before comparing.
Will this catch formula changes?
Only if you compare formulas rather than values. Show formulas with Ctrl + ` on each sheet side by side, or use Inquire, which reports formula differences.