Blog
How to Compare Two Excel Sheets for Differences
To compare two Excel sheets, you either compare cells in the same position or match rows by a key column and compare what comes back. If both sheets have the same rows in the same order, =Sheet1!B2=Sheet2!B2 is enough. Real comparisons rarely look like that. A vendor's new price list arrives sorted differently, with a few items dropped and a few added, and one missed price change flows straight into next month's purchase orders and cost of goods.
Below are the methods that fit each situation, a complete price list comparison from start to finish, and what to check when the results look wrong.
Pick the method by how the sheets line up
| Situation | Method | Output |
|---|---|---|
| Same rows, same order | =Sheet1!B2=Sheet2!B2 | TRUE or FALSE per row |
| Same layout, you want to see the differences | Conditional formatting =B2<>Sheet2!B2 | Changed cells colored |
| Different order, shared key such as SKU | VLOOKUP or XLOOKUP | The other sheet's value, or #N/A |
| Rows that exist in only one sheet | COUNTIF or MATCH | 0 or #N/A means missing |
| Tens of thousands of rows, repeated monthly | Power Query merge | A separate result table |
The rule of thumb: if you can't be sure row 50 on one sheet is the same item as row 50 on the other, don't compare by position. Use a key column that is unique per row.
1. The = operator for identical layouts
Put =Sheet1!B2=Sheet2!B2 in a helper column and fill down. TRUE means the values match; FALSE means they don't. Filter the helper column to FALSE and only the changed rows remain.
Two details trip people up. The = operator ignores case, so "abc-01" equals "ABC-01"; use =EXACT(A2,B2) when case matters. And the number 12000 does not equal the text "12000", so a file exported from another system can show FALSE on every row until the formats match.
2. Conditional formatting to color what changed
Select the range on the first sheet, go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format, and enter =B2<>Sheet2!B2 with a light red fill.

Leave B2 without dollar signs so each cell compares to its own counterpart. This is the fastest way to eyeball changes, but it doesn't produce a list you can send to anyone, so for a report move on to the lookup methods.
3. VLOOKUP or XLOOKUP when the order differs
Match rows by key and pull the other sheet's value next to yours. =VLOOKUP(A2,New!$A:$C,3,FALSE) finds the SKU from A2 in column A of the New sheet and returns the third column, the price. The last argument must be FALSE (or 0) for an exact match.

A key that isn't on the other sheet returns #N/A, and that #N/A is information: it means "missing". Label it instead of hiding it. Wrapping the lookup in IFERROR replaces the error with text you choose.

In Microsoft 365 and Excel 2021 or later, XLOOKUP is simpler: =XLOOKUP(A2,New!$A:$A,New!$C:$C,"Missing"). You point at the lookup column and return column separately, so there's no column number to count, and the fourth argument sets the not-found text directly.
4. COUNTIF or MATCH for rows on one side only
When you only need to know whether a key exists, COUNTIF reads most clearly. =COUNTIF(New!$A:$A,A2) returns 0 if the SKU is gone from the new list. Run the same check in the other direction to find new items. =MATCH(A2,New!$A:$A,0) returns the row position, or #N/A when the key isn't there.

Worked example: comparing a vendor's new price list
Lakeview Distribution's buyer gets an email from Crestview Foods with next quarter's price list attached. The current list has 412 SKUs; the new one has 418, sorted by category instead of SKU. Prices in the new file are text like "$12.50", and some SKUs carry trailing spaces from the vendor's export.

Step 1: Put both lists in one workbook
Right-click the new sheet's tab, choose Move or Copy, pick the current price workbook, tick Create a copy, and rename the copy New. Work on a copy of the price file, not the master.
Step 2: Clean the keys and prices first
On the New sheet, add helper columns: =TRIM(A2) for the SKU and =VALUE(SUBSTITUTE(C2,"$","")) for the price. Skip this and the same SKU returns #N/A, and the same price shows as changed.
Step 3: Pull the new price beside the current one
On the current sheet, column E gets =XLOOKUP(A2,New!$F:$F,New!$G:$G,"Missing") against the cleaned columns. Column F gets the difference, =IF(E2="Missing","",E2-D2), and column G the percent change, =IF(E2="Missing","",E2/D2-1), formatted as a percentage.
Step 4: Split the result three ways
Filter column E to "Missing" for discontinued items. Filter column G to non-zero for changed prices and sort it descending so the largest increases sit on top. On the New sheet, =COUNTIF(Current!$A:$A,F2) equal to 0 marks the new items. Say that produces 3 discontinued, 9 new and 27 changed: the buyer reviews 39 lines instead of 412.
Step 5: Review and apply
Anything up more than 10% goes back to the vendor with a question; the rest goes into the item master. Reply with five columns only (SKU, item, current price, new price, percent change) so the vendor can answer line by line. When updating the master, use Paste Special > Values so the prices survive after the New sheet is deleted.
👉 VLOOKUP Not Working? How to Fix #N/A, #REF! and #VALUE!
Why a lookup returns #N/A for rows that exist
When a SKU is clearly on both sheets but the lookup says #N/A, the values are different in a way you can't see:
- Number stored as text. A green triangle in the cell's corner gives it away. Use Convert to Number or wrap the key in
--A2orVALUE(). - Hidden spaces or line breaks. If
=LEN(A2)is longer than the visible text, clean it withTRIMandCLEAN. - A drifting range. A lookup range without dollar signs shifts as you fill down, so lower rows search a smaller area. Lock it with
$A:$C.
The reverse also happens: prices that differ in the third decimal place look identical because of number formatting. =ROUND(E2-D2,2) in the difference column shows what really changed. Before trusting any comparison, look up three or four SKUs by hand on both sheets. It takes a minute and catches a wrong key column right away.
Large lists: compare with a Power Query merge
At tens of thousands of rows, thousands of lookup formulas make a workbook slow. Power Query does the comparison outside the grid. Load each list with Data > From Table/Range, then in the Power Query Editor choose Home > Merge Queries, select the SKU column in both, and choose the join kind.
The join kind is the comparison. Left Anti returns rows only in the first table, which are your discontinued items. Right Anti returns rows only in the second, the new items. An Inner join plus a custom column that subtracts the two prices isolates the changes. Close & Load writes the result to a sheet, and next quarter you paste the new list into the source table and click Refresh All.
Comparing two whole workbooks
To compare two files visually, open both and click View > Window > View Side by Side, with Synchronous Scrolling on so both scroll together. For two sheets in the same file, click New Window first, then View Side by Side.
When you need every difference in values, formulas and formatting cell by cell, use Microsoft's Spreadsheet Compare. According to Microsoft's Spreadsheet Compare guide, it ships with Office Professional Plus 2013, 2016 and 2019 and Microsoft 365 Apps for enterprise. Launch it from the Windows Start menu, click Compare Files, choose the two workbooks, and the results grid colors differences by type. It isn't included in Microsoft 365 Personal or Business Standard, where the formula methods above do the job.
FAQ
Q. Can I use the = operator if the rows are in a different order?
No. It compares cells in the same position, so a different order gives wrong answers. Sort both sheets by the same key first, or use XLOOKUP, VLOOKUP or COUNTIF, which find rows by value.
Q. What if there is no SKU, only item names?
Build a combined key on both sheets, such as =TRIM(B2)&"|"&TRIM(C2) for item name and pack size, and match on that. Items whose names are spelled slightly differently will show as missing, so gather those rows and check them by hand.
Q. How do I compare several columns at once?
Concatenate the columns into one string on each sheet and compare the strings. Any row where one column differs shows up. To see which column changed, keep one comparison formula per column.
Q. Can I compare against a sheet in another workbook?
Yes. With both files open, click into the other workbook while writing the formula and Excel inserts a reference like [NewPrices.xlsx]Sheet1!$A:$C. Close that file and the reference becomes a full path, and moving the file breaks it, so for a one-time comparison copy the sheet into the same workbook.
How inline AI compares price lists
inline AI opens the vendor's attached price list next to your current one, and when you say "compare by SKU and split out changed prices, new items and dropped items," it cleans the formats, matches the rows and returns the three lists. With ARP, the prices you confirm go straight into the item master and the next purchase order.
Hand your documents and your company’s work to inline AI.
Keep a file open, say what you need, and AI edits it or drafts a new one. Add the company AI OS and AI runs the rest of the work, ERP included.
Book a demo



