Comparing data

How to Compare Two Lists in Excel and Find What Is Missing

By the DecodingPro teamUpdated 3 min read

Quick answer

To find items in list A that are missing from list B, put =IF(COUNTIF($B$2:$B$5000,A2)=0,"Missing","Found") next to list A and fill it down. In Microsoft 365 you can use =IF(ISNA(XLOOKUP(A2,B:B,B:B)),"Missing","Found"). Clean both lists first (spaces and capitals), or equal items will look different.

Comparing two lists is the job behind most reconciliations: which customers are not in the new system, which orders were never paid, which emails are on the unsubscribe list. Excel can do it in a minute, provided the lists are clean.

Step 0: clean both lists first

"John.Smith@Example.com " and "john.smith@example.com" are the same person and different text. Before comparing, trim and lowercase both columns:

=LOWER(TRIM(A2))

See removing extra spaces if a comparison still fails on items that look identical.

Method 1: COUNTIF (works in every version)

Next to list A (column A), in B2, with list B in column D:

=IF(COUNTIF($D$2:$D$5000,A2)=0,"Missing from B","In both")

Fill it down. To find the opposite (items in B that are not in A), put a mirror formula beside list B.

Method 2: XLOOKUP or MATCH

In Microsoft 365 or Excel 2021:

=IF(ISNA(XLOOKUP(A2,$D:$D,$D:$D)),"Missing from B","In both")

In older versions use MATCH:

=IF(ISNA(MATCH(A2,$D:$D,0)),"Missing from B","In both")

MATCH with 0 as the last argument means "exact match", which is what you want.

Method 3: highlight without formulas

Select both lists, then Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values. Choose "Unique" instead of "Duplicate" to colour only the items that appear once, in other words the differences.

Comparing two sheets

Use the same formulas and refer to the other sheet: =COUNTIF(Sheet2!$A$2:$A$5000,A2). If the comparison needs several columns to match (for example first name, last name and date of birth), add a helper column that joins them: =LOWER(TRIM(A2))&"|"&LOWER(TRIM(B2))&"|"&C2, then compare the helper columns.

Why a comparison says "missing" when the item is there

ReasonHow to checkFix
Hidden spaces or non-breaking spaces=LEN(A2) is longer than it looksClean both lists
Numbers stored as text in one listOne side is left-alignedConvert text to numbers
Different spelling or typosThe items differ by a letterFix the typos, or use a fuzzy tool
Different capitalsCOUNTIF ignores case, but exact formulas such as EXACT do notLowercase both
Leading zeros lost00123 against 123Keep IDs as text in both

Exact matches are not always enough

Lists from two systems rarely match perfectly: one has "St." where the other has "Street", one has "Jon" where the other has "John". Formulas only find exact equality. A cleaning pass that normalises dates, phone numbers, emails and spacing first makes far more items match.

Try it on your own file

You start with 100 free credits. Every change is logged, and anything unclear is flagged, never guessed.

Fix a spreadsheet

Questions people ask

How do I get a list of only the missing items?

Filter the result column for "Missing", then copy the visible rows. In Microsoft 365, =FILTER(A2:A5000,COUNTIF(D2:D5000,A2:A5000)=0) returns them directly.

Is there a limit to how many rows I can compare?

Excel handles hundreds of thousands of rows, but COUNTIF over a very large range for each row gets slow. Sorting both lists and using MATCH with a sorted lookup, or Power Query's Merge feature, is much faster.

Can I compare lists without formulas?

Yes: Power Query's Merge, with join kind "Left Anti", returns exactly the rows in one list that are not in the other.

Keep reading

01Excel data cleaningHow to Clean Messy Excel Data: A Step-by-Step GuideThe fixed order that stops one fix from undoing another, with the formulas for every step.10 min read02Text and numbersHow to Keep Leading Zeros in Excel and CSV (ZIP Codes, IDs)Why Excel turns 02134 into 2134, how to get the zeros back, and how to stop it happening when you open a CSV.5 min read03CSV and importsHow to Clean a CSV File Before Importing It Into a CRMSeven fixes that prevent duplicate contacts, rejected rows and scrambled characters, and the 10-row test to run first.4 min read04DatesHow to Fix Dates in Excel and CSV Files (Mixed Formats)Text dates, day-month swaps, two-digit years and the one rule that makes dates safe to share.8 min read05Phone numbersHow to Fix Phone Numbers in Excel: Format and Country CodesLeading zeros, 9.19E+11, country codes and the international format that every system accepts.6 min read06DuplicatesHow to Remove Duplicates in Excel Without Losing DataExact, near and partial duplicates: decide what counts, mark before you delete, keep the best record.6 min read07DuplicatesHow to Find and Highlight Duplicates in ExcelFind repeats safely first: highlight them, count them, keep the first one, and spot the near-duplicates Excel does not see.3 min read08NamesHow to Standardize Names in Excel: Proper Case and ExceptionsWhat PROPER gets wrong, how to protect names that are already right, and how to flip "Smith, John" into "John Smith".4 min read09Email addressesHow to Fix Email Typos in Excel: gmial.com, .con and Missing @The typos that make campaigns bounce, and the formulas and checks that fix them without guessing.4 min read10Email addressesHow to Clean an Email List Before You Send a CampaignA five-step routine that removes the avoidable bounces from a list without deleting anyone you should keep.3 min read11NamesHow to Split Full Names into First and Last Name in ExcelFlash Fill, Text to Columns and formulas for splitting names, and the names that trip each one up.4 min read12Text cleanupHow to Remove Extra Spaces in Excel (TRIM, CLEAN and Non-Breaking Spaces)Why TRIM sometimes does nothing, and the one formula that removes every kind of stray space.3 min read13Text cleanupHow to Remove Special Characters and Line Breaks in ExcelThe characters you cannot see, the smart quotes you can, and the exact formula or shortcut that removes each one.4 min read14NumbersHow to Convert Text to Numbers in Excel (Numbers Stored as Text)Why sums show zero, why numbers sit on the left, and four ways to turn text back into real numbers.3 min read15Excel data cleaningHow to Clean Data with Power Query in Excel (Step by Step)Record your cleaning steps once and replay them on every new file, without formulas and without touching the original data.4 min read17CSV and importsFix Garbled Characters and Broken CSV Imports (UTF-8)UTF-8, delimiters, leading zeros, quotes and a checklist that makes a file safe to import.7 min read18Data entryData Entry Accuracy: How to Check, Measure and Improve ItWhat the research says about error rates, why proofreading fails and the checks that actually work.9 min read