How to Compare Two Lists in Excel (5 Easy Ways)

Which customers are on last month’s list but not this month’s? Which invoice numbers in the bank export are missing from your records? Comparing two lists is one of the most common Excel jobs. Here are five easy ways to do it.

Example: List A (A2:A100) = customers in September. List B (B2:B100) = customers in October.

1. Highlight items that appear in both lists (fastest)

  1. Select both columns (hold Ctrl to select A2:A100 and B2:B100).
  2. Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values.
  3. Choose Duplicate to color matches, or Unique to color items found in only one list.

It’s quick and visual, but it also flags duplicates within the same list.

2. Mark each item as “Found” or “Missing” with COUNTIF

In C2, next to List A:

=IF(COUNTIF($B$2:$B$100, A2)>0, "Found", "Missing")

Copy down. “Missing” means the customer was in September but not in October. Swap the ranges to check the other direction. Learn more in SUMIFS and COUNTIFS.

3. List only the missing items with FILTER

=FILTER(A2:A100, COUNTIF(B2:B100, A2:A100)=0, "None missing")

Returns a clean list of everything in A that’s not in B (Excel 365/2021+). See UNIQUE, SORT and FILTER.

4. Bring back details with XLOOKUP

If List B has more columns (like amount or date), pull them across and show “Not found” when missing:

=XLOOKUP(A2, Sheet2!A:A, Sheet2!C:C, "Not found")

See XLOOKUP explained. Older Excel: =IFERROR(VLOOKUP(A2,Sheet2!A:C,3,FALSE),"Not found").

5. Compare row by row

When two columns should match line by line (e.g. before and after an update):

=IF(A2=B2, "Same", "Different")

This ignores upper/lower case. For an exact, case-sensitive check, use =EXACT(A2,B2). See case-sensitive lookups.

Highlight differences: select both columns → Conditional Formatting → New Rule → “Use a formula” → =$A2<>$B2 → choose a fill color.

Common reasons matches fail

  • Extra spaces or hidden characters: clean with TRIM and CLEAN.
  • Numbers stored as text in one list: see numbers stored as text.
  • Different formats: “INV-0042” vs “INV-42”, or dates vs text dates.
  • Typos: “Al Noor Trading” vs “Al-Noor Trading.”

Which method should you use?

Goal Method
Quick visual check Conditional formatting → Duplicate Values
Label each item COUNTIF → Found / Missing
A list of what’s missing FILTER + COUNTIF
Bring back details XLOOKUP
Same row, same value? A2=B2 or EXACT

Example: find missing invoices

Column A holds the invoice numbers from your accounting system; column B holds the invoice numbers from the bank export. To see which invoices have not been paid yet:

A: System B: Bank C: Status in system list
INV-101 INV-101 Paid
INV-102 INV-104 Not paid
INV-103 INV-103 Paid
INV-104 Paid

Formula in C2, copied down: =IF(COUNTIF($B$2:$B$100,A2)>0,"Paid","Not paid"). INV-102 is the only invoice that is not in the bank list. In Excel 365, list all of them at once with =FILTER(A2:A100,COUNTIF(B2:B100,A2:A100)=0).

Compare two lists in different files

  1. Open both workbooks.
  2. In the first file, start your formula, for example =COUNTIF(, then click the other workbook and select the column.
  3. Excel writes a reference such as [October.xlsx]Sheet1!$A$2:$A$100. Finish the formula and copy it down.
  4. If the other file will move or be emailed, copy the second list into a new sheet of the first workbook instead. External links break easily.

For lists you compare every month (bank statement vs invoices, stock count vs system), Power Query can merge the two lists and show the unmatched rows with one click on Refresh.

Google Sheets

COUNTIF, XLOOKUP and conditional formatting work the same. FILTER uses this syntax: =FILTER(A2:A100, COUNTIF(B2:B100, A2:A100)=0).

FAQ

How do I compare two lists in Excel to find differences?
Use COUNTIF to mark each item as found or missing, for example =IF(COUNTIF(List2,A2)=0,”Missing”,”Found”), or highlight duplicates with conditional formatting to see the matches at a glance.

How do I compare two columns in Excel for matches?
To compare row by row use =A2=B2 (TRUE or FALSE). To check whether a value appears anywhere in the other column, use COUNTIF.

Why do identical-looking values not match?
Usually extra spaces, numbers stored as text, or different spellings. Clean the lists with TRIM and convert text numbers before comparing.

Can I compare two lists on different sheets?
Yes. Refer to the other sheet in the formula, for example =COUNTIF(Sheet2!A:A,A2).

Related guides

About the author

I’m Abdelazim Nasr, a software developer with more than 20 years of experience building business systems: general ledger reporting, fixed asset management and data synchronisation jobs, using SQL Server, Delphi, Laravel and MySQL. The guides and templates on SimplifyLearn come from that day-to-day work. Spotted a mistake? Let me know.

Leave a Comment