How to Compare Two Excel Sheets (4 Ways)

Compare two Excel sheets for differences: view them side by side, flag changed cells with a formula, find missing rows with COUNTIF, or run Spreadsheet Compare.
The template
Copy prompt
Open [file A.xlsx] and [file B.xlsx]. Compare the [sheet name] tabs row by row using [ID column] as the key. In a new tab called Differences, list rows that exist in only one file and every cell that changed, with the old and new value. Don't edit the original tabs.
Advanced computer use agent
Production-grade reliability
Transparent Execution

Why compare two sheets

Two versions of a price list, this month's CRM export against last month's, a client's edits to your budget: the question is always "what changed?" Scrolling two windows works for 30 rows, not for 3,000. Excel has four ways to answer it, depending on your version and how the two sheets line up.

Quick answer: For a quick look, open both and select View > View Side by Side, then Synchronous Scrolling. To flag every changed cell, put a formula like =IF(Sheet1!A2<>Sheet2!A2,"Changed","") in a third sheet and fill it across. To find rows missing from one list, use =COUNTIF(Sheet2!A:A,A2)=0. If you have Microsoft 365 Apps for enterprise on Windows, Inquire > Compare Files highlights every difference for you.

Let Sai handle your repetitive work

Delegate to Sai

How to Compare Two Excel Sheets (4 Ways)

Which way should you use?

MethodNeedsBest forLimits
View Side by SideAny desktop ExcelEyeballing two short sheetsYou still spot changes by eye
IF formula in a third sheetAny ExcelSame layout, cell-by-cell changesRows must line up; inserted rows shift everything
COUNTIF / XLOOKUP on a keyAny Excel (XLOOKUP in newer versions)Lists sorted differently; finding added or removed rowsNeeds a unique key column
Spreadsheet CompareExcel for Windows, Microsoft 365 Apps for enterpriseAuditing two versions of a workbook, including formulas and VBANot in other plans or on Mac
AI computer agent (Sai)Your Excel filesThe same comparison every week or across many filesDefine the key column and review the first run
How to choose a method to compare two Excel sheets: View Side by Side, IF formula, COUNTIF, Spreadsheet Compare or Sai

Method 1: View two sheets side by side

  1. Open both workbooks. For two sheets in the same workbook, select View > New Window first.
  2. Select View > View Side by Side. With more than two workbooks open, pick the one to compare in the Compare Side by Side box.
  3. In each window, click the sheet you want.
  4. Select Synchronous Scrolling so both scroll together.

Method 2: Flag changed cells with an IF formula

  1. Add a new sheet called Differences.
  2. In A2, enter =IF(Sheet1!A2<>Sheet2!A2,"Sheet1: "&Sheet1!A2&" | Sheet2: "&Sheet2!A2,"").
  3. Fill the formula across and down to cover the used range.
  4. Every non-blank cell is a change, with both values shown.

Use this when both sheets have the same rows in the same order.

Method 3: Find rows that are missing from one sheet

  1. Pick a column that is unique per row, such as an order ID or email.
  2. In Sheet1, next to the data, enter =COUNTIF(Sheet2!A:A,A2)=0.
  3. TRUE means that row is not in Sheet2. Repeat the other way round to find rows only in Sheet2.
  4. To pull a value from the other sheet for the same key, use XLOOKUP or VLOOKUP and compare.

Method 4: Use Spreadsheet Compare (Microsoft 365 Apps for enterprise)

  1. In Excel for Windows, select Inquire > Compare Files. If there's no Inquire tab, turn on the Inquire add-in.
  2. Choose the two files and select OK.
  3. Review the two-pane grid: differences are colored by type, with a legend at the lower left.
  4. Select Home > Export Results to save the differences as an Excel file.

Spreadsheet Compare also checks VBA code and compares hidden sheets.

Hand recurring comparisons to an AI computer agent

Sai is an AI computer agent that works in the apps on your computer, like a person, and asks before critical steps.

Finance scenario: weekly price list check. Every Monday Sai opens the supplier's new price list and last week's, compares them by SKU, and writes a Differences tab with new, removed and repriced items.

Ops scenario: CRM export audit. Sai compares this month's customer export with last month's by email and lists customers who disappeared, so someone can follow up.

Pros: same key and the same output every time. Cons: it needs a reliable key column; review the first run.

What are the limits?

  • Spreadsheet Compare is only in Excel for Windows with Microsoft 365 Apps for enterprise and equivalent editions.
  • Cell-by-cell formulas break when one sheet has inserted or deleted rows; compare by key instead.
  • Extra spaces and different number formats make equal values look different.

Sources: Microsoft – Compare two or more worksheets at the same time; Microsoft – Compare two versions of a workbook by using Spreadsheet Compare. Steps checked on December 3, 2026.

Scale sheet comparisons with Sai

Pick the key column
Tell Sai which column identifies a row, such as SKU, order ID or email.
Test on one pair
Compare one pair of files and check the Differences tab.
Run it every week
Schedule the comparison or run it on each new export.

Stop doing repetitive tasks. Let Sai handle them for you.

Sai is your AI computer use agent — it operates your apps, automates your workflows, and gets work done while you focus on what matters.

Try Sai

FAQS