How to compare two lists in Excel and find missing items
29 November 2026
To find items in one Excel list that are missing from another, put a formula beside the first list that counts how often each item appears in the second. =COUNTIF($B$2:$B$500, A2)=0 returns TRUE for anything missing. Then do the same the other way round. If a formula says an item is missing when you can see it in both lists, the cause is usually a stray space or a number stored as text.
The examples assume list A is in column A and list B in column B, from row 2 down, with headings in row 1. Change the ranges to fit your sheet. The $ signs keep list B's range fixed when you fill a formula down.
1. COUNTIF: the quickest check
Good for: any version of Excel, on Windows or Mac.
- In C2, enter:
=IF(COUNTIF($B$2:$B$500, A2)=0, "Missing from B", "")
- Fill it down to the end of list A. Double-clicking the fill handle, the small square at the bottom-right of the cell, does this for you.
COUNTIF counts how many times the item in A2 appears in list B, and zero means it isn't there. Turn on Data > Filter and filter column C to see only the missing items. Use =COUNTIF($B$2:$B$500, A2) on its own to see the count instead: 2 or more means the item is in list B more than once.
2. MATCH or XLOOKUP with ISNA
Good for: exact matching, and fetching a related value at the same time.
MATCH returns an item's position in a list, or the #N/A error if it isn't there. ISNA turns that error into TRUE. This works in every version of Excel:
=IF(ISNA(MATCH(A2, $B$2:$B$500, 0)), "Missing from B", "")
The 0 means exact match. Leave it out and MATCH assumes the list is sorted, and can give a wrong answer.
In Microsoft 365 and Excel 2021 or later, XLOOKUP can check for the item and fetch something with it. If your second list is on a sheet called Stock, with codes in column A and quantities in column C, this returns the quantity, or "Missing":
=XLOOKUP(A2, Stock!$A$2:$A$500, Stock!$C$2:$C$500, "Missing")
In older versions, VLOOKUP does the same, as long as the codes are in the first column of the range:
=IFNA(VLOOKUP(A2, Stock!$A$2:$C$500, 3, FALSE), "Missing")
3. Highlight missing items with conditional formatting
Good for: seeing the gaps in the list itself.
- Select the items in list A, for example A2:A120, not the whole column.
- Choose Home > Conditional Formatting > New Rule, then Use a formula to determine which cells to format.
- Enter
=COUNTIF($B$2:$B$500, A2)=0, written for the first cell of your selection. - Choose Format, pick a fill colour on the Fill tab, and choose OK twice.
For a rougher check, select both lists and choose Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values, then change Duplicate to Unique. Items that appear only once across both lists are highlighted. It won't tell you which list they came from, and it misses an item that's repeated within one list.
4. Check the other direction too
Good for: seeing what's new in list B as well as what's missing from it.
The formulas above only find items in A that aren't in B. To find items in B that aren't in A, swap the ranges. In D2, enter this and fill it down to the end of list B:
=IF(COUNTIF($A$2:$A$500, B2)=0, "Missing from A", "")
If A is last month's list and B is this month's, column C shows what was removed and column D what was added.
In Microsoft 365 or Excel 2021 or later, FILTER lists them all at once. The results spill downwards, so put it in a column with empty cells below:
=FILTER(B2:B500, ISNA(MATCH(B2:B500, A2:A500, 0)) * (B2:B500<>""), "Nothing missing")
Why a match fails when the item is clearly there
Most false "missing" results come down to one of these:
- Extra spaces. "Smith " with a trailing space doesn't match "Smith".
=TRIM(A2)removes spaces at the start and end, and turns runs of spaces into one. - Non-breaking spaces. Text copied from web pages can contain a space character that TRIM leaves alone.
=TRIM(SUBSTITUTE(A2, CHAR(160), " "))removes both kinds. - Numbers stored as text. The number 1001 and the text "1001" look the same, but MATCH, XLOOKUP and VLOOKUP treat them as different. Excel often marks text numbers with a small green triangle: select the cells, click the warning icon and choose Convert to Number. Or use
=VALUE(TRIM(A2))in a helper column.
Put the cleaned values in helper columns for both lists and point your formulas at those. None of these methods is case-sensitive, so "smith" and "SMITH" count as a match.
When each item is a whole row
These formulas are all you need for one column of names or codes. They get fiddly when each item is a row with several columns, such as two months of a customer export, and you also want to know what changed in the rows that are in both.
That's the job Compare Sheets does. Choose the ID column to match rows by, and it shows the added and removed rows, plus each changed cell with its old and new value. It can ignore extra spaces and upper or lower case. It runs in your browser on Windows or Mac, and the files never leave your computer. The free version compares the first 1,000 rows of each sheet, and you can try it with sample files.
Quick answers
How do I find items that are in one list but not the other? Put =COUNTIF($B$2:$B$500, A2)=0 next to each item in list A, then repeat with the lists swapped. TRUE means the item is missing from the other list.
Can I compare two lists on different sheets? Yes. Include the sheet name in the range, for example =COUNTIF(Sheet2!$A$2:$A$500, A2)=0. If the name has spaces, put it in single quotes: 'Old list'!$A$2:$A$500.
Why does my formula say an item is missing when I can see it? Usually a hidden space, or a number stored as text in one list. Clean both lists with TRIM, and VALUE for numbers, then compare again.