
Comparing two lists is a frequent data-cleaning task: which customer is new, which is missing, which product is on both lists? Excel has several methods.
Method 1: COUNTIF, present or not
Say List 1 is in column A and List 2 in column C. In B2:
=IF(COUNTIF($C$2:$C$500,A2)>0,"In both","Only in List 1")Fill down. To see the reverse, build the same logic for column C. See our COUNTIF guide for details.
Method 2: Colour with conditional formatting
- Select A2:A500.
- Home > Conditional Formatting > New Rule > Use a formula.
- Enter
=COUNTIF($C$2:$C$500,A2)=0. - Pick a colour.
Records not in List 2 are highlighted. The same tool finds duplicates (see our remove duplicates guide).
Method 3: VLOOKUP / XLOOKUP
=IFERROR(VLOOKUP(A2,$C$2:$D$500,2,FALSE),"Not found")This returns both the match and a value from another column (such as price). See our VLOOKUP and XLOOKUP guides.
Method 4: FILTER to list differences (Microsoft 365)
=FILTER(A2:A500,COUNTIF(C2:C500,A2:A500)=0)This outputs items in List 1 that are not in List 2 as a separate list. For common items use >0 instead of =0.
Row-by-row comparison
To compare cells in the same position in two columns:
=IF(A2=C2,"Same","Different")To catch case differences too, use EXACT(A2,C2).
Why matches fail
If records look identical but don't match, the causes are:
- Leading or trailing spaces → clean with
TRIM(see our text functions guide). - A number stored as text versus a real number.
- Different spelling ("Ltd." and "Ltd").
- Invisible characters.
Cleaning both lists first is the safest step.
Power Query for big data
If you do the same comparison each month, Power Query's Merge Queries (Left Anti join) extracts differences automatically (see our Power Query guide).
Which method?
| Situation | Method |
|---|---|
| Quick flagging | COUNTIF + IF |
| Visual check | Conditional formatting |
| Need matching data | VLOOKUP / XLOOKUP |
| List of differences | FILTER |
| Recurring job | Power Query |
Step-by-step example: comparing a subscriber list with a CRM list
Say column A holds newsletter subscribers' addresses and column C the customer addresses in the CRM. The aim: who is a subscriber but not a customer, who is a customer but not a subscriber?
| Question | Formula (write in B2, drag down) |
|---|---|
| Is the subscriber also a customer? | =IF(COUNTIF($C$2:$C$500,A2)>0,"Customer","Not a customer") |
| Is the customer also a subscriber? | =IF(COUNTIF($A$2:$A$500,C2)>0,"Subscriber","Not a subscriber") |
| Addresses common to both lists | =FILTER(A2:A500,COUNTIF(C2:C500,A2:A500)>0) (Microsoft 365) |
| Only in the first list | =FILTER(A2:A500,COUNTIF(C2:C500,A2:A500)=0) (Microsoft 365) |
Before comparing, standardise the emails with TRIM and LOWER; otherwise "Ali@x.com " and "ali@x.com" count as different (see our data cleaning guide).
A checklist for matching problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Obvious matches not found | Spaces, letter case | TRIM, LOWER |
| Numbers don't match | One is text, one is a number | VALUE or equalise the format |
| More matches than expected | Duplicate records | Clear duplicates first |
| Long codes match wrongly | The 15-digit limit | Keep the criterion as text (&"*" or text format) |
| Missing rows | Blank cell / hidden row | Check the data range and filter |
A practical route for big data
With thousands of rows formulas slow down. Compare the two tables with Power Query's "merge" operation; a "Left Anti" merge gives only those in the first, an "Inner" merge gives the common ones (see our Power Query guide). The result updates automatically when the data is refreshed.
Frequently asked questions
When is row-by-row comparison used? When the two lists are in the same order and the same length =A2=B2 is enough; if the order differs you need COUNTIF/VLOOKUP.
How do I colour the differing ones when comparing two columns? Use the rule =COUNTIF($B:$B,A1)=0 in conditional formatting (see our conditional formatting guide).
Is case-sensitive comparison possible? COUNTIF is case-insensitive; the EXACT function is case-sensitive.
How do I report the comparison result? You can show "Customer / Not a customer" counts with a pivot table (see our pivot table guide).
What should I watch when working with personal data? Protect the file, delete unneeded columns before sharing and follow data protection rules (see our protect sheet and digital footprint guides).
Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.