Smart Systems for Home

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

Compare Two Excel Files & Highlight Differences

· 7 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

When you have two versions of the same spreadsheet—maybe one sent by a colleague, one you edited yourself—spotting what changed by eye is slow and error-prone. This guide shows you how to make Excel do the comparison for you and paint the differences in color, so you can see at a glance which cells were added, removed, or altered.

What You'll Need

  • Two Excel files (or two sheets in the same workbook) that you want to compare.
  • Excel 2013 or newer (the steps below use the built-in Compare Sheets feature, which is available in Microsoft 365 and Excel 2016+). If you have an older version, the manual method in Step 4 still works.
  • Both files should have the same structure—same columns in the same order. If the columns are in a different order, the comparison will flag every row as different.

Step-by-Step

  1. Open both workbooks. Launch Excel and open the two files you want to compare. They can be open in separate windows or side by side. If you only have one file with two sheets, make sure both sheets are visible in the same workbook.
  2. Launch the Compare Sheets tool (easiest method). In Excel 2016 or later, go to the Home tab. On the far right, look for the Compare Sheets button (it's in the “Changes” group). If you don't see it, you may need to add it: click File > Options > Quick Access Toolbar, then choose “All Commands” from the dropdown, find “Compare Sheets,” and add it. Once visible, click it.
  3. Select the two sheets to compare. A dialog box will appear. In the left dropdown, pick the first sheet (e.g., “Sheet1” from File A). In the right dropdown, pick the second sheet (e.g., “Sheet1” from File B). Make sure you choose the correct files—the dropdown lists all open sheets. Click OK.
  4. Review the highlighted differences. Excel will open a new window showing both sheets side by side. Cells that are different are highlighted in a light red or yellow fill. A small “Changes” pane on the left lists each difference as a row, showing the cell reference and the old/new values. Scroll through this list to see every change.
  5. Use the manual formula method (works in any Excel version). If you can't use the built-in tool, create a third sheet (or a new column) and use a formula. In cell A1 of a new sheet, type: =IF(Sheet1!A1=Sheet2!A1,"","DIFF"). Drag this formula across the entire range you want to compare. Every cell that shows “DIFF” is different. To highlight them, select the range, go to Home > Conditional Formatting > New Rule > Use a formula, and enter =A1="DIFF", then set a fill color.
  6. Use the “Go To Special” method for a quick visual check. If you just want to see which cells differ without a new sheet, select both ranges (Ctrl+click to select two ranges), press F5 (or Ctrl+G), click Special, choose Row differences, and click OK. Excel will select all cells that differ from the corresponding cell in the other selection. Then just fill them with a color manually.
  7. Save or export the comparison. The Compare Sheets tool doesn't save the highlighted view as a file automatically. If you want to keep it, copy the highlighted sheet to a new workbook, or take a screenshot. The manual formula method leaves a permanent record in your workbook.

Common Mistakes

  • Comparing sheets with different row/column orders. If row 5 in File A is “John Smith” but row 5 in File B is “Jane Doe,” every cell will show as different even if the data is just shuffled. Sort both files the same way before comparing.
  • Forgetting to include the full range. The Compare Sheets tool only compares the range that has data in both sheets. If one file has extra rows, those won't be flagged unless you extend the selection.
  • Formatting differences count as differences. The tool compares values, not formatting. But if you use the manual formula, it only compares values too. If you want to flag formatting changes, you'll need a VBA macro—outside the scope of this guide.
  • Trailing spaces or invisible characters. Two cells that look identical may differ because one has a space at the end. Use =TRIM(A1) in a helper column to clean data before comparing.
  • Numbers stored as text. “100” as text and “100” as a number will show as different. Convert one to the other using the “Text to Columns” wizard or the VALUE function.

Tips

  • Use the “Changes” pane to navigate. In the Compare Sheets view, click each row in the left pane to jump to that cell in both sheets. This is much faster than scrolling manually.
  • Filter the changes list. The Changes pane has a filter dropdown. You can show only added, only removed, or only changed cells.
  • Compare more than two sheets. You can run Compare Sheets multiple times. For example, compare File A to File B, then File B to File C, to see a chain of changes.
  • Use a unique key column. If your data has an ID column (e.g., customer ID), sort both files by that column first. That way, row order doesn't matter—the comparison will be meaningful.
  • Save a backup before comparing. If you plan to merge changes, keep the original files untouched. The Compare Sheets tool doesn't modify your originals, but your manual edits might.

Troubleshooting

  • “Compare Sheets” button is missing. It's not in the ribbon by default in some versions. Add it via File > Options > Quick Access Toolbar > All Commands > Compare Sheets. Or, if you have Microsoft 365, search for “Compare” in the “Tell Me” box at the top.
  • The tool says “No differences found” but you know there are. Check that both sheets have the same number of rows and columns. If one sheet has blank cells where the other has data, the blank cells are “differences” but may be ignored if the range isn't selected. Also check that you picked the correct sheets—it's easy to pick the same sheet twice.
  • Highlighting is too subtle. The default fill is light red. If you can't see it, change the fill color manually: select the highlighted cells, go to Home > Fill Color, and pick a stronger shade like bright yellow.
  • Comparing large files is slow. The tool may freeze on files with hundreds of thousands of cells. Try comparing only the range you care about, or split the file into smaller chunks.
  • Formula method shows all cells as “DIFF”. This usually means the sheet names in the formula are wrong. Check that “Sheet1” matches the actual tab name. If your sheet is named “Data 2024,” you need =IF('Data 2024'!A1='Data 2024'!A1,...) with quotes around the name.

Frequently Asked Questions

Q: Can I compare two files that have different column orders?
A: Yes, but the Compare Sheets tool will flag every row as different because the values in each column won't match. You should reorder the columns in one file to match the other before comparing, or use a VLOOKUP-based approach to match by a key column.

Q: Does Compare Sheets work with .xlsx and .xls files?
A: Yes, it works with both modern .xlsx and older .xls formats. Just open both files in Excel first.

Q: Can I highlight differences in both files at the same time?
A: The built-in tool shows the differences in a new comparison window, not in the original files. If you want the original files highlighted, use the manual formula method with conditional formatting, or copy the results back.

Q: How do I compare more than two files?
A: Run Compare Sheets multiple times. There's no built-in multi-file comparison, but you can compare File A to B, then B to C, and manually merge the results.

Q: Will the comparison ignore cells that are blank in both files?
A: Yes, if both cells are blank, they're considered equal. But if one is blank and the other has a space character, they'll show as different. Use TRIM to clean data first.

Q: Can I compare sheets that are in the same workbook?
A: Yes, absolutely. Open the workbook, then in the Compare Sheets dialog, pick “Sheet1” from the left dropdown and “Sheet2” from the right dropdown. Both will be from the same file.