Skip to content
SmallBizDesk
All tools

Compare two Excel files

See which rows were added, removed or changed between two versions of a spreadsheet, or what two lists have in common. Download a copy with every difference highlighted.

Compare two files

Not uploaded.

AOlder or original

Drop a file here, or .

BNewer, or the one to check

Drop a file here, or .

Excel (.xlsx, .xls), OpenDocument or CSV. Drop both at once and the older one becomes A.

How to compare two Excel files

  1. Put the older or original file in A and the newer one in B. Drop both at once and the one saved earlier becomes A.
  2. Check Match rows by. If a column identifies each row, such as an ID, SKU or invoice number, it's picked for you.
  3. Read the result: rows that changed, rows only in B and rows only in A. Click a count to see only that kind.
  4. Download the highlighted report, or the list of changes as CSV.

How rows are matched

To say a row changed, the tool first has to know which row in B is the same row from A. There are three ways, and the right one depends on your data.

  • By an ID column. The most reliable. Rows are paired by a value that identifies them, so sorting, inserted rows and deleted rows don't matter. Any column that is filled in and unique in both files is offered, with ID-like names first.
  • By whole rows. For lists without an ID. A row in A matches a row in B when every shared column is the same. It finds rows only in one file, but it can't tell an edited row from a new one: an edit shows as one row only in A and one only in B.
  • By row position. Row 2 with row 2, row 3 with row 3. Only right when neither file was sorted and no rows were inserted; otherwise every row after the first insert looks changed.

Values are compared after setting aside extra spaces, and numbers are compared as amounts: 12, 12.00 and $12.00 are the same price. Capital letters count as a difference unless you tick Ignore capital letters.

A worked example

A shop's inventory exported at the end of March and again at the end of April, sorted differently:

inventory-march.csv

RowABCD
1SKUItemPriceIn stock
2TS-101Cotton tee (black)12.0096
3HD-200Pullover hoodie34.0040
4TB-500Canvas tote bag14.0060

inventory-april.csv

RowABCD
1SKUItemPriceIn stock
2HD-200Pullover hoodie36.0040
3TS-101Cotton tee (black)12.5096
4WB-600Water bottle18.0050
March (A) and April (B). The rows are in a different order, so comparing row by row would be useless.

Matched by SKU, the report shows two price changes, one new item and one that was dropped:

march-vs-april-differences.xlsx

RowABCDE
1ChangeSKUItemPriceIn stock
2ChangedHD-200Pullover hoodie36.00 (changed)40
3ChangedTS-101Cotton tee (black)12.50 (changed)96
4, addedOnly in BWB-600Water bottle18.0050
5, removedOnly in ATB-500Canvas tote bag14.0060
Yellow: a changed value. Green: only in April. Red and struck through: only in March.

The sample files in the tool are a longer version of this, including a Supplier column that only the April file has. It's listed, and left out of the comparison.

Reading the highlighted report

The report is the newer file with three columns added at the front, Change, Row in A and Row in B, and a What changed column at the end that spells out each edit, such as Price: 34.00 → 36.00. Rows only in A are added at the bottom.

  • a yellow cell is a value that changed
  • a green row is only in B: it was added
  • a red, struck-through row is only in A: it was removed

The header row is frozen and has filters, so filtering the Change column to “Changed” gives you just the edits. A second tab, Summary, has the counts and the names of the files you compared.

Comparing two lists: matches and missing items

The same tool answers “who is on this list but not that one?” Put your full list in A and the other in B, for example everyone you invoiced and everyone who paid, then match by a shared column such as Email or Invoice number.

  • Only in A: on the first list and missing from the second. Who hasn't paid.
  • Only in B: on the second list only.
  • Same or Changed: on both lists. Changed means the other columns differ, such as a different amount.

If one list has repeats of its own, clean it first with Remove duplicates; repeated IDs are paired in order, which is rarely what you want for a list.

Comparing in Excel itself

Microsoft's Spreadsheet Compare does this inside Office, but only comes with Office Professional Plus and Microsoft 365 Apps for enterprise on Windows. Most small business editions don't include it.

With plain Excel, View > View Side by Side puts two workbooks next to each other and scrolls them together, which works for a quick look at short files. For two lists, a formula finds what's missing: next to each value in the first list, =COUNTIF(Sheet2!A:A, A2)=0 returns TRUE when it isn't in column A of Sheet2.

Both approaches break down when files are sorted differently or have hundreds of rows, which is where matching by an ID column earns its keep.

Questions

Can I compare two sheets in the same workbook?

Yes. Choose the workbook as file A and again as file B, then pick a different sheet on each side.

What if the rows are in a different order?

Match rows by an ID column, such as an order number, SKU or email address, and the order doesn't matter. Matching by row position only works when both files are in the same order.

Can it compare files with different columns?

Yes. Columns are matched by name. A column that only one file has is listed and left out of the comparison, so it doesn't make every row look changed.

Does it compare formulas and formatting?

It compares values. A formula is compared by the value it last calculated, and changes to colors or fonts aren't counted. Numbers are compared as amounts, so 12, 12.00 and $12.00 count as the same.

How big can the files be?

There's no set limit; the files are read in your browser, so the practical limit is your computer's memory. In our tests, two files of 100,000 rows each were compared and the highlighted report saved in under ten seconds.

Are my files uploaded anywhere?

No. Both files are read by your browser on your computer, and the report is created there too. Nothing is sent to a server.

Last updated by Muhammad Yahya.