Open a second window with View › New Window, then click View › View Side by Side and Synchronous Scrolling. For an exact check, use a formula like =A2=Sheet2!A2 and copy it down.

You often need to compare two versions of a workbook—for example, last month's budget vs. this month's, or a list before and after updates—to spot what changed. Excel has built-in tools for a quick visual check and formulas for an exact cell-by-cell comparison.
Step by step
- Open the workbook and click View › New Window. A second window of the same workbook opens.
- In the new window, click the tab of the other sheet you want to compare.
- Click View › View Side by Side, then Synchronous Scrolling so both windows scroll together. Use Arrange All › Vertical if you prefer them side by side rather than stacked.
- For an exact check, go to the first sheet and in an empty column type
=A2=Sheet2!A2(change the cell and sheet name). - Press Enter and copy the formula down. TRUE means the cells match; FALSE means they differ.
- Optionally, use Home › Conditional Formatting › Highlight Cells Rules › Equal To with FALSE to colour the differences.
On a Mac: On a Mac, the Side by Side button is on the View tab but Synchronous Scrolling may not be available; use a formula instead.
Before and after
| A | B | C | |
|---|---|---|---|
| 1 | Item | Q1 | Q2 |
| 2 | Pens | 4 | 4 |
| 3 | Paper | 10 | 12 |
| 4 | Clips | 2 | 2 |
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Item | Q1 | Q2 | Match? |
| 2 | Pens | 4 | 4 | TRUE |
| 3 | Paper | 10 | 12 | FALSE |
| 4 | Clips | 2 | 2 | TRUE |
The macro
Press Alt+F11, choose Insert › Module, paste the code, then press F5 to run it. Save the file as .xlsm to keep the macro.
Highlight cells on Sheet1 that differ from Sheet2
Sub CompareSheets()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim cell As Range
Set ws1 = ThisWorkbook.Sheets("Sheet1")
Set ws2 = ThisWorkbook.Sheets("Sheet2")
For Each cell In ws1.UsedRange
If cell.Value <> ws2.Range(cell.Address).Value Then
cell.Interior.Color = vbYellow ' highlight differences
End If
Next cell
End SubWith a formula instead
| Formula | Use it when |
|---|---|
=IF(A2=Sheet2!A2,"Match","Different") | You want a clear text label instead of TRUE/FALSE. |
=COUNTIF(Sheet2!A:A,A2)>0 | You only need to check if a value exists in the other sheet, not exact cell position. |
Practise it
Free exercises with instant feedback. No sign-up needed.
Common mistakes
- The formula returns #REF! because the sheet name is misspelled or missing quotes. Use the exact sheet name; if it contains spaces, wrap it in single quotes, e.g. =A2='Sheet 2'!A2.
- Synchronous Scrolling is greyed out or not working. Make sure both workbooks are open and you have clicked Side by Side first; then enable Synchronous Scrolling.
- Comparing cells with different data types (e.g., number vs. text) gives FALSE even if they look the same. Use =EXACT(A2,Sheet2!A2) for case-sensitive text comparison, or convert values to the same type.
Questions people also ask
Can I compare two Excel files, not just sheets?
Yes. Open both files, then on the View tab click Side by Side. You can also use a formula with an external reference like ='[Book2.xlsx]Sheet1'!A1.
How do I highlight all differences at once?
Select the first sheet's data (for example A2:D50), then Home › Conditional Formatting › New Rule › Use a formula, enter =A2<>Sheet2!A2 and pick a fill. Every cell that differs from the same cell on Sheet2 is coloured.
Is there a built-in compare tool in Excel?
Not in every version. Spreadsheet Compare and the Inquire add-in come with Microsoft 365 Apps for enterprise and Office Professional Plus. Otherwise, use View Side by Side or a formula.
Functions used
Steps written for Excel for Microsoft 365 on Windows. All how-to guides