How to Compare Two Spreadsheets in Excel for Differences
In this article
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
- 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.
- 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.
- Create a new worksheet in one of the files (right-click any tab > Insert > Worksheet). Name it something like "Comparison".
- In the new Comparison sheet, in cell A1, type "Row" and in B1 type "Difference Found".
- 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).
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.