Smart Systems for Home

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

How to Compare Two Spreadsheets in Excel for Differences

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

Comparing two Excel spreadsheets side by side reveals discrepancies in data, formulas, formatting, or structure—helping you catch errors, track changes, or validate updates. This method works for any version of Excel from 2010 onward and requires no add-ins or third-party tools. You’ll need both files open and access to Excel’s built-in functions like conditional formatting and basic formulas.

What You'll Need

  • Microsoft Excel (2010 or later)
  • Two spreadsheet files with comparable data structures (same column order, headers, row counts where possible)
  • Basic familiarity with Excel formulas and formatting

Step-by-Step

  1. Open both Excel files you want to compare. Keep them side by side on your screen using Windows Snap (drag each window to left/right edge of screen) or use View > Arrange All > Tiled if on a large monitor.
  2. Ensure both sheets have identical column headers in the same order. If they don’t, reorder columns in one file to match the other. Mismatched headers will cause false positives in comparisons.
  3. Create a new worksheet in one of the files (right-click any tab > Insert > Worksheet). Name it something like "Comparison".
  4. In the new Comparison sheet, in cell A1, type "Row" and in B1 type "Difference Found".
  5. Starting in cell A2, enter the formula: =ROW(). This will list row numbers. Drag this formula down to cover all rows present in your data sheets (e.g., if each sheet has 500 rows of data, drag to A501).
  6. In cell B2, enter this formula: =IF(AND(Sheet1!A2<>"",Sheet2!A2<>""),IF(Sheet1!A2=Sheet2!A2,"","Cell A2 Mismatch"),IF(OR(Sheet1!A2="",Sheet2!A2=""),"Missing Value","")). This checks if both cells are populated and equal. Adjust "Sheet1" and "Sheet2" to match your actual sheet names.
  7. Copy the formula in B2 across all columns you want to compare. For example, if comparing columns A through E, drag the formula from B2 to F2. Then drag all of row 2 down to match your data rows.
  8. Apply conditional formatting to highlight differences: Select the entire range of your comparison results (e.g., B2:F501). Go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. Enter: =B2<>"". Set the format to red fill or bold text. Click OK.
  9. Filter the Comparison sheet: Select the header row (A1:B1), then go to Data > Filter. Click the dropdown in column B and uncheck "(Blank)" to show only rows with differences.
  10. Review each highlighted row in the Comparison sheet. Cross-reference the original sheets to confirm the nature of each difference—whether it’s a typo, formula error, missing entry, or formatting issue.
  11. For a faster visual check, go back to your original sheets. Select the first data cell in the top-left of the range you’re comparing (e.g., A2). Press Ctrl+Shift+Down to select the entire column down to the last row. Copy it. Switch to the other sheet, select the same cell (A2), and press Ctrl+Shift+Down to select the matching column. Go to Home > Conditional Formatting > New Rule > Use a formula > enter: =A2<>Sheet1!A2. Format with red fill. Repeat for each column.

Common Mistakes

  • Comparing sheets with different column orders—this causes Excel to compare wrong cells, leading to thousands of false mismatches.
  • Forgetting to lock cell references when copying formulas across columns, which breaks the comparison logic.
  • Not accounting for leading/trailing spaces or different capitalization—"New York" vs. "new york" will appear as a difference unless you use TRIM() and UPPER() in your formula.
  • Assuming identical row counts—some sheets may have extra rows or missing entries. Always verify row counts first using =COUNTA(A:A) in both sheets.
  • Using cell references without specifying the sheet name, which causes Excel to reference the wrong file if both are open.

Tips

  • Use =TRIM(Sheet1!A2)=TRIM(Sheet2!A2) in your comparison formula to ignore accidental spaces.
  • For case-insensitive comparisons, use =UPPER(Sheet1!A2)=UPPER(Sheet2!A2).
  • Use the Go To Special feature (Ctrl+G > Special > Row differences) to quickly jump between mismatched rows after applying conditional formatting.
  • Save a backup copy before making changes based on your comparison findings.
  • If comparing large datasets (10,000+ rows), consider using Power Query to merge and compare tables instead—this is more efficient and scalable.
  • Use a helper column to flag changes with a simple "Yes" or "No" instead of long text messages—this makes filtering and sorting easier.

Troubleshooting

  • If formulas return #REF! errors, check that sheet names in your formulas match exactly—including spaces and capitalization. Open the workbook and double-click the sheet tab to copy the exact name.
  • If conditional formatting doesn’t highlight anything, ensure the applied range matches your data range and that the formula uses relative references correctly (e.g., B2 not $B$2).
  • If Excel becomes slow during comparison, close other applications, save your work, and restart Excel. Large comparisons consume memory.
  • If you can’t see differences even after formatting, check for date or number formats. A number formatted as currency in one sheet and as general in another may display differently but be numerically equal. Use =VALUE() to force numeric conversion if needed.
  • If Excel crashes when applying formatting to large ranges, reduce the range size temporarily (e.g., compare 100 rows first) to test the method, then expand.

Frequently Asked Questions

Can I compare two Excel files that are not open at the same time?

No—you must have both files open. Excel formulas reference open workbooks directly. If one file is closed, you’ll get a #REF! error. Use Power Query to import data from closed files if needed.

What if the spreadsheets have different numbers of rows?

Compare only the overlapping range. Extend the shorter sheet with blank rows if needed, or filter out extra rows in the longer sheet before comparing. Always align row counts manually before starting.

Can I compare formulas instead of values?

Yes. Replace the comparison formula with =FORMULATEXT(Sheet1!A2)=FORMULATEXT(Sheet2!A2). This only works if both cells contain formulas. If one contains a value and the other a formula, it will flag as a mismatch.

Why are some cells showing as different when they look identical?

Hidden characters like non-breaking spaces, line breaks, or Unicode characters can cause mismatches. Use =CLEAN(TRIM(Sheet1!A2)) and =CLEAN(TRIM(Sheet2!A2)) to remove these.

Is there a built-in Excel tool to compare spreadsheets?

Excel has no native side-by-side comparison tool. The Compare feature in Excel’s Review tab only works for comparing changes in the same workbook after track changes is enabled—not between two separate files.

Can I compare Excel files with different column layouts?

Not reliably without restructuring. You must align column order and headers first. Otherwise, Excel compares column A to column C by default, which creates meaningless mismatches. Always standardize structure before comparing.