Comparing two Excel sheets helps identify discrepancies, track changes, or verify data accuracy across versions or sources. This can be done using built-in Excel tools without add-ins or external software—just Excel installed on your computer.

What You'll Need

  • Microsoft Excel (2016 or later; steps work in Excel for Microsoft 365, Excel 2021, Excel 2019, and Excel Online with limitations)
  • Two workbooks or two worksheets containing comparable data (same structure, headers, row/column count recommended)
  • Basic familiarity with Excel navigation (selecting cells, using formulas, and the ribbon)

Step-by-Step

  1. Open both Excel files you want to compare. If they’re in the same workbook, ensure each dataset is on a separate sheet.
  2. Align the data structure: confirm both sheets have identical column headers, same order, and same number of rows. If not, insert/delete columns or rows to match before proceeding.
  3. Use the Conditional Formatting method for visual comparison:
    1. Select the range you want to compare (e.g., A1:D100 on Sheet1).
    2. Go to Home > Conditional Formatting > New Rule.
    3. Choose Use a formula to determine which cells to format.
    4. Enter a formula like =A1<>Sheet2!A1 (replace Sheet2 with the actual sheet name, and adjust cell references to match your selection).
    5. Click Format, pick a fill color (e.g., light red), then OK twice.
    6. Repeat steps 3–5 for the second sheet (e.g., on Sheet2, use =A1<>Sheet1!A1), applying the same color to highlight mismatches consistently.
  4. For a side-by-side visual scan, copy both ranges into a new sheet:
    1. Create a new sheet (e.g., named “Compare”).
    2. Copy the first dataset (e.g., Sheet1!A1:D50) and paste into column A.
    3. Copy the second dataset (e.g., Sheet2!A1:D50) and paste into column F (leaving one column gap).
    4. In cell B1, enter =IF(A1=Sheet2!A1,"Match","Diff"), then drag the fill handle down and across to apply to all rows/columns.
    5. Filter column B for “Diff” to quickly see mismatches.
  5. Use the Compare Side by Side window feature (desktop only):
    1. Open both workbooks.
    2. Go to View tab > Compare Side by Side.
    3. A new window appears with both files displayed. Scroll both simultaneously using the Synchronous Scrolling toggle (also on the View tab).
    4. Manually spot-check differences—this is best for layout or formatting checks, not data values.
  6. For advanced comparison, use the Power Query tool (Excel 2016+):
    1. Go to Data > Get Data > From Other Sources > From Workbook, then select each file and load the relevant sheet as a query.
    2. Load both queries into the Power Query Editor.
    3. Select one query, then go to Home > Append Queries > Append Two Queries to combine them, or use Merge Queries to join by key column (e.g., ID).
    4. In the merged table, expand columns and add a custom column with =if [Sheet1.Column] = [Sheet2.Column] then "Match" else "Diff".
    5. Filter for “Diff” and load the results back to Excel.

Common Mistakes

  • Comparing cells with different formatting (e.g., one sheet uses numbers, another uses text) without normalizing data types first—use Text to Columns or =VALUE() to convert.
  • Ignoring hidden rows/columns or filtered views—unhide and clear filters before comparing.
  • Using absolute references (e.g., $A$1) in formulas instead of relative (e.g., A1), causing mismatches in conditional formatting.
  • Skipping header rows: formulas like =A1<>Sheet2!A1 will flag headers as differences—start comparisons at row 2 if headers exist.
  • Assuming identical row order means identical data—rows may be reordered between sheets, making row-by-row comparison misleading.

Tips

  • For large datasets, filter out blank rows first to speed up comparison and reduce false positives.
  • Use Ctrl+G (Go To) > Special > Blanks to quickly locate empty cells that might cause gaps.
  • For numeric data, account for rounding differences by using =ROUND(A1,2)<>ROUND(Sheet2!A1,2) in formulas.
  • Save your comparison sheet as a template for future use (e.g., name it “Diff_Report.xlsm” and store it in your Excel startup folder).
  • Use Excel Online’s built-in Compare feature only if both files are stored on OneDrive or SharePoint—go to Review > Compare > Compare Documents.

Troubleshooting

If differences aren’t showing:

  • Check for extra spaces or non-printing characters: Use =TRIM(A1) and =CLEAN(A1) in helper columns before comparing.
  • Verify sheet names: If a sheet is renamed (e.g., “Sheet1” to “Original”), update all formulas—Excel won’t auto-adjust sheet references.
  • Ensure no merged cells: Merged cells break relative references in formulas—unmerge them first.
  • Confirm calculation mode: Press Ctrl+Alt+F9 to force full recalculation if formulas don’t update after edits.
  • Check for protected sheets: If sheets are protected, unprotect them (right-click sheet tab > Unprotect Sheet) before applying formatting or formulas.
  • For Power Query issues: Rebuild the query from scratch—corrupted queries often fail silently. Load each source sheet as a new query before merging.

Frequently Asked Questions

Can I compare two Excel files that have different numbers of rows?

Yes—use Power Query to merge on a unique key (like an ID column) instead of row position. Alternatively, use conditional formatting with =COUNTIF(Sheet2!$A:$A,A1)=0 to find rows in Sheet1 not present in Sheet2.

Does Excel have a built-in “Compare” button like Word?

No—Excel lacks Word’s Track Changes or Compare Documents feature. You must use conditional formatting, formulas, or Power Query as described above.

Can I compare sheets in different workbooks?

Yes—open both workbooks and reference them directly in formulas (e.g., =A1<>[Report_Old.xlsx]Data!A1). Ensure both files are saved locally or on the same network to avoid path errors.

Why do some cells show as different when they look identical?

Common causes include extra spaces (use TRIM), different data types (e.g., “123” vs. 123), regional number formats (e.g., 1,234.56 vs. 1.234,56), or hidden characters (use CLEAN). Always compare values, not display formats.

Is there a way to see only the changed cells, not all differences?

Use the helper-column method: add a column with =IF(A2=Sheet2!A2,"","Changed") and filter for non-blank cells. For multiple columns, combine with AND: =IF(AND(A2=Sheet2!A2,B2=Sheet2!B2,C2=Sheet2!C2),"","Changed").

Can I automate this comparison with a macro?

Yes—record a macro while applying conditional formatting, or write VBA code to loop through cells and highlight mismatches. Save the file as .xlsm, and assign the macro to a button for reuse.