How to Compare Two Excel Files: 5 Ways, From Quick to Reliable
Two Excel files, one question: what changed? The answer depends on one thing most guides skip. Do you want to compare cell A2 with cell A2, or row 102 with row 102 wherever it moved to? Pick the wrong one and every method below gives you noise.
Open the Compare Two Excel Files
First decide what "compare" means
There are two kinds of comparison, and they fail in different ways.
- **By position.** Cell A2 in the first file against cell A2 in the second. This works only if both files have the same layout in the same order. Insert one row and everything below it looks different.
- **By key.** Match each row by an id, such as a customer or order number, then compare the values. Sorting, inserted rows and deleted rows no longer matter. This is what you want for exports, reports and any data that changes over time.
If your files are small and laid out the same way, position is fine. For everything else, use a key.
Way 1: View Side by Side (quick look)
Open both workbooks, then on the View tab choose View Side by Side. Excel places the windows next to each other and can scroll them together. It is a good first look at a small sheet. It does not mark differences for you, so your eyes do the work, and that stops working past a few dozen rows.
Way 2: A formula on a third sheet (by position)
Add a new sheet and compare the matching cells. In A1 of the new sheet, assuming the two sheets are named Old and New:
=IF(Old!A1<>New!A1, "changed", "")Fill it down and across the used range. Every cell that says "changed" is different. You can also add a conditional formatting rule to colour the cells. This is simple and free, but it only compares by position, so one inserted row ruins the result.
Way 3: Microsoft Spreadsheet Compare
Microsoft has a tool called Spreadsheet Compare that lists differences between two workbooks, including formulas and formatting. Microsoft documents it as part of certain Office editions, so check whether yours includes it before you plan around it. It is a desktop tool for Windows and is good when you care about formulas and formatting, not only values.
Way 4: Power Query (by key, no code)
Power Query can match two tables by a key. Load both tables, then use Merge Queries on the key column. Choose a Left Anti join to see rows that exist in the first table but not the second, and swap the tables to find the opposite. To find changed values, merge on the key, expand the other table's columns and add a column that checks whether the two values are equal. It works well, but it takes some setup each time.
Way 5: A key-column comparison tool
The Data Comparison tool does the by-key comparison without setup. In the browser:
1. Load the old file as A and the new file as B.
2. Choose the key column, for example customer_id. You can also use the first column or the first two columns.
3. Read the result: rows added, rows removed and rows changed, with the old and new value of each changed cell.
4. Download the differences as CSV, Excel, JSON or Parquet.
It can trim spaces, ignore upper and lower case and accept a small difference on numbers, which removes a lot of false alarms. It reads the first sheet of each Excel file. Everything runs in your browser, so the files are not uploaded. There is a page just for comparing two Excel files.
Why a comparison shows differences that are not real
- **Spaces.** "Ada" and "Ada " look the same but are not equal. Trim before comparing.
- **Numbers stored as text.** 100 and "100" are different to a formula.
- **Rounding.** 0.1 + 0.2 and 0.3 can differ in the last digits. Allow a small tolerance.
- **Case.** "UK" and "uk" are different unless you ignore case.
- **Other sheets.** A comparison of the first sheet says nothing about the rest of the workbook.
Which method should you use?
- Small, identical layout, quick look: side by side or a formula.
- Care about formulas and formatting: Spreadsheet Compare, if your Office includes it.
- Data that changes over time, with an id column: compare by key with Power Query or a comparison tool.
- Files too big or too sensitive to send anywhere: use a tool that runs on your own computer, such as Power Query or a browser tool that does not upload.
Open the Compare Two Excel Files
Related tool pages
- Data Comparison: Compare CSV, Excel, JSON and Parquet Files: Compare two CSV, Excel, JSON, Parquet or Avro files by a key column. See inserts, updates and deletes (CDC), cell by cell. Free, in your browser.
- Compare Two CSV Files: Compare two CSV or Excel files by a key column and see added, removed and changed rows. Free, runs in your browser.
- Compare Two Parquet Files: Compare two Parquet files by a key column and see every added, removed and changed row and cell. Free, runs in your browser, nothing is uploaded.
- Compare Two JSON Files: Compare two JSON files by a key field and see which records were added, removed or changed, down to the nested field. Free, in your browser.
- Compare Two Avro Files: Compare two Avro files by a key field and list the added, removed and changed records. Reads the embedded schema, runs in your browser. Free.
- Compare CSV with Parquet: Check that a Parquet file matches the CSV it was made from: find rows and values that differ after a conversion or migration. Free, in your browser.
Also try
How to use the Compare Two Excel Files: step by step
- Load the old file as A and the new file as B.
- Choose the key column that identifies a row, such as an id.
- Read the added, removed and changed rows and download the differences.
When to use the Compare Two Excel Files
- Check what changed between two exports
- Reconcile two versions of a report
- Find new and removed customers
- Review a data migration
Example
Input: before.xlsx + after.xlsx, key = id
Output: Added 3 · Removed 2 · Changed 5
Frequently asked questions
How do I compare two Excel files for differences?
For small files with the same layout, use View Side by Side or a formula such as =IF(Old!A1<>New!A1,"changed",""). For files that change over time, match rows by a key column with Power Query or a comparison tool.
What is the difference between comparing by position and by key?
By position compares cell A2 with cell A2, so an inserted row makes everything below look different. By key matches each row by an id first, so sorting and inserted or deleted rows do not matter.
Can I compare two Excel files for free online?
Yes. The Data Comparison tool compares two files by a key column in your browser and shows added, removed and changed rows. Nothing is uploaded.
Does it compare every sheet in the workbook?
No. It reads the first sheet of each Excel file. To compare other sheets, save each one as its own file first.
Why do I see differences that are not real?
Usually trailing spaces, numbers stored as text, tiny rounding differences or upper and lower case. Trim spaces, ignore case and allow a small tolerance on numbers.
Tip: If the result shows far more changes than you expected, trim spaces and ignore case first. Most false differences come from those two.