ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Data tools
  3. Compare Two Excel Sheets and Highlight the Differences

Compare Two Excel Sheets and Highlight the Differences

By ExcelReady Team·Updated November 3, 2026·5 min read

The short answer

To compare two sheets in Excel cell by cell, add a third sheet and enter =IF(Old!A1<>New!A1,"Different","") in A1, then fill it across and down. To highlight the changes instead, use a conditional formatting rule such as =A1<>New!A1. If rows can be in a different order, match them by ID with COUNTIF or XLOOKUP.

Key takeaways

  • A cell-by-cell IF formula on a third sheet shows exactly which cells differ, and what each sheet holds.
  • A conditional formatting rule like =A1<>New!A1 colors the changed cells on the sheet itself.
  • Row-by-row checks only work when both sheets list the same records in the same order.
  • When rows are added, removed or sorted, match on an ID column with COUNTIF and XLOOKUP instead.
On this page+
  1. Which method should you use?
  2. Compare two sheets cell by cell with IF
  3. Highlight differences with conditional formatting
  4. Why row-by-row comparison can mislead you
  5. Compare rows by ID when the order changes
  6. Look at two sheets side by side
  7. Practise it

To compare two sheets in Excel, you either check them cell by cell (when both have the same layout and order) or by ID (when rows may have moved, been added or been removed). A simple IF formula, a conditional formatting rule and COUNTIF cover both cases, in any version of Excel. This guide is for anyone who has an old and a new version of a report and needs to know exactly what changed.

Which method should you use?#

The right method depends on whether the rows still line up:

SituationBest methodWhat you get
Same layout, same row orderIF formula on a third sheetA grid showing every changed cell
Same layout, want to see changes in placeConditional formatting ruleChanged cells colored on the sheet
Rows added, removed or sortedCOUNTIF and XLOOKUP on an ID columnMissing, new and changed records
Just want to lookView Side by SideBoth sheets scrolling together

All the examples use two sheets in one workbook, named Old and New, each with invoice IDs in column A and amounts in column B:

RowOld: IDOld: AmountNew: IDNew: Amount
2INV-101250INV-101250
3INV-102480INV-102520
4INV-103125INV-104900
5INV-104900INV-105310
6INV-105310INV-10675

Between the two versions, INV-102 changed from 480 to 520, INV-103 was removed, and INV-106 was added.

Compare two sheets cell by cell with IF#

A comparison sheet checks each cell against the same cell on the other sheet. Add a new sheet (Windows: Shift+F11; Mac: Fn+Shift+F11, or click the + next to the tabs), then type this in A1:

Excel formula
=IF(Old!A1<>New!A1,"Old: "&Old!A1&" | New: "&New!A1,"")

Fill it right and down to cover the whole data area. A cell stays blank when both sheets match, and shows both values when they don't. <> means "not equal to"; the IF function guide explains the three parts of IF.

If you only want TRUE or FALSE, a bare comparison is enough: =Old!B3=New!B3 returns FALSE here, because 480 is not 520. The lesson on TRUE, FALSE and comparisons covers how these work. Comparisons with = ignore capitals; the guide to comparing two cells shows how to use EXACT when case matters.

If the sheet names contain spaces, Excel needs quotes around them: ='Old data'!A1.

Highlight differences with conditional formatting#

Conditional formatting colors cells that meet a rule, so you see changes right on the sheet:

  1. On the Old sheet, select the data, for example A1:B6, starting from A1.
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose Use a formula to determine which cells to format.
  4. Enter =A1<>New!A1 and click Format to pick a fill color.
  5. Click OK.

Write the rule for the top-left cell of your selection, with no $ signs. Excel then moves the reference for each cell, so B3 checks against New!B3. The guide to conditional formatting with a formula explains why the $ matters, and the conditional formatting lesson lets you try formula rules hands-on. Rules that refer to another sheet work in Excel 2010 and later.

Why row-by-row comparison can mislead you#

Cell-by-cell checks assume the same record sits on the same row in both sheets. In our example, that's only true for rows 2 and 3. Because INV-103 was removed, everything below moved up one row.

A row-by-row check of the amounts flags 4 differences (rows 3 to 6), but only one amount actually changed. The others are the same invoices sitting on different rows. So use cell-by-cell methods only when you're sure the rows line up, such as two copies of a fixed template.

Compare rows by ID when the order changes#

When rows can move, match them on a column that uniquely identifies each record, such as an invoice ID or employee number.

Find records missing from the new sheet. On the Old sheet, in C2:

Excel formula
=IF(COUNTIF(New!$A$2:$A$6,A2)=0,"Missing","Found")

COUNTIF counts how many times the ID appears in the New sheet. Zero means it's gone. Fill it down and INV-103 shows Missing. The COUNTIF function guide covers the syntax. Do the same on the New sheet against Old's IDs to find new records: INV-106 is the only one.

Find changed values. In Excel 2021 or Microsoft 365, bring back the new amount with XLOOKUP, then compare. In D2 on the Old sheet:

Excel formula
=XLOOKUP(A2,New!$A$2:$A$6,New!$B$2:$B$6,"Missing")

For INV-102 this returns 520. Then =IF(D2="Missing","Missing",IF(D2=B2,"Same","Changed")) labels each row. In older Excel, use VLOOKUP with FALSE in place of XLOOKUP. The guide to comparing two lists shows more ways to find matches and gaps, and the guide to finding duplicates in two columns covers the overlap.

Lock the lookup ranges with $ before you fill down, or they'll slide off the data.

Look at two sheets side by side#

Sometimes you just want to scroll through both. On Windows:

  1. Go to View > New Window. A second window of the same workbook opens.
  2. In the new window, click the other sheet's tab.
  3. Go to View > View Side by Side. Synchronous Scrolling turns on, so both scroll together.

On a Mac, open the second window from Window > New Window and arrange the two windows next to each other.

Some Windows editions of Office also include Spreadsheet Compare, a separate program that lists every difference between two workbooks, including formulas and formatting. If you don't see it, the formula methods above do the job in any edition.

Practise it#

Most sheet comparisons come down to COUNTIF and a comparison inside IF. Practise COUNTIF in a live spreadsheet: you type the formula and it checks it instantly. Then learn TRUE, FALSE and comparisons and color cells with formula rules. Try the exercise on this page first. If you also need to spot repeats within one sheet, see how to highlight duplicates.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Old invoices are in A2:B6 and the new list is in D2:E6. Is INV-103 (cell A4) still in the new list? Click G4 and use IF with COUNTIF on D2:D6: show Missing if it isn't found, otherwise Found.

fx
ABCDEFGH
1
Old ID
Old amount
New ID
New amount
2
INV-101
250
INV-101
250
3
INV-102
480
INV-102
520
4
INV-103
125
INV-104
900
5
INV-104
900
INV-105
310
6
INV-105
310
INV-106
75
7
8
9

Tip: COUNTIF(D2:D6,A4) counts how often INV-103 appears in the new list. If that count is 0, it's missing.

Practise this in a lesson

LessonConditional formattingMake important numbers stand out: highlight values over a limit, duplicate IDs and the top 3, then color whole rows with a formula rule and a $ on the column.LessonTRUE, FALSE and comparisonsAsk Excel yes-or-no questions with =, <>, >, <, >= and <=, and get TRUE or FALSE back. The building block of every IF.LessonCOUNTIFCount the cells that match a condition, from exact words to number checks like ">=8".Function guideIFLearn Excel's IF function with practical examples: flag budgets, label rows and return blanks. Avoid the classic mistakes and practice live.Function guideCOUNTIFCount cells that match one condition with COUNTIF: text, numbers, wildcards and cell references. Real examples and a live exercise.

Frequently asked questions

How do I compare two Excel sheets for differences?

+

Add a new sheet, type =IF(Sheet1!A1<>Sheet2!A1,"Different","") in A1, and fill it across and down to cover the data. Every cell that shows Different has changed between the two sheets.

How do I highlight differences between two sheets?

+

Select the data on the first sheet, choose Home > Conditional Formatting > New Rule > Use a formula, and enter =A1<>Sheet2!A1, with A1 being the top-left cell you selected. Pick a fill color and click OK.

How do I compare two sheets when the rows are in a different order?

+

Match on a unique ID instead of the row position. =COUNTIF(Sheet2!A:A,A2)=0 shows TRUE for IDs missing from the second sheet, and XLOOKUP brings back the matching value so you can compare it.

Does Excel have a built-in tool to compare two files?

+

Some Windows editions of Office include Spreadsheet Compare, which compares two workbooks and lists every difference. If you don't have it, formulas and conditional formatting do the same job inside Excel.

Is comparing sheets in Excel case-sensitive?

+

No. The = and <> operators ignore capitals, so Apple and APPLE count as the same. Use EXACT, such as =NOT(EXACT(Sheet1!A1,Sheet2!A1)), when capitals matter.

Sources

  • IF function - Microsoft Support
  • COUNTIF function - Microsoft Support
  • Use conditional formatting to highlight information - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Which method should you use?
  2. Compare two sheets cell by cell with IF
  3. Highlight differences with conditional formatting
  4. Why row-by-row comparison can mislead you
  5. Compare rows by ID when the order changes
  6. Look at two sheets side by side
  7. Practise it

Keep reading

Lookups· 5 min read

How to Compare Two Lists in Excel

To compare two lists in Excel, use COUNTIF to check whether each item in one list appears in the other: =IF(COUNTIF($C$2:$C$6,A2)>0,"Yes","No"). To list the missing items in one go, use FILTER with COUNTIF. To see the differences at a glance, add a conditional formatting rule that highlights items with no match.

Text· 6 min read

Compare Two Cells in Excel (Exact, Ignoring Case or Spaces)

To compare two cells in Excel, type =A2=B2. It returns TRUE if they match and FALSE if they don't, and it ignores capital letters. Use =EXACT(A2,B2) when case matters, =TRIM(A2)=TRIM(B2) to ignore extra spaces, and wrap any of these in IF to show words like "Match" or "Different" instead of TRUE or FALSE.

Data tools· 6 min read

Find Duplicates Between Two Columns in Excel

To find duplicates between two columns in Excel, check each value in the first column against the second with COUNTIF: =COUNTIF($B$2:$B$9,A2)>0 returns TRUE when A2 also appears in column B. Fill it down, or use the same test as a conditional formatting rule to highlight the matches. In Excel 2021 or Microsoft 365, FILTER can list them all.

More on data tools

  • Conditional Formatting in Excel: Highlight What Matters
  • Conditional Formatting With a Formula in Excel
  • Custom Sort in Excel: Sort by Your Own Order
  • Data Bars, Color Scales and Icon Sets in Excel
  • Create a Drop-Down List in Excel
  • Data Validation Rules in Excel: Limit What Users Can Enter
All data tools articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free