Which customers are on this month’s list but not last month’s? Which products disappeared from the new price sheet? Which email addresses from the event sign-up are already subscribers? These are all the same task: comparing two lists and finding what is different and what they share.
This guide shows three ways to do it, from a quick online check to formulas in Excel and Google Sheets, and explains how to prepare your data so the comparison is accurate.
Three questions you can answer
When you compare List A with List B, you usually want one or more of these:
- Only in A: items that were removed or are missing from B.
- Only in B: items that are new or were added.
- In both: items the lists have in common (the overlap or intersection).
Decide which answer you need before you start; it determines which formula or view to use.
Step 1: clean the lists first
Most “wrong” comparison results come from data that looks identical to a person but not to a computer. Before comparing, check for:
- Extra spaces at the start or end of an item, or double spaces in the middle. “Asha Verma ” with a trailing space will not match “Asha Verma”.
- Different capitalisation. Decide whether “Pune” and “pune” should count as the same. If yes, convert both lists to the same case with the Text Case Converter.
- Different formats for the same value, such as “+91 98765 43210” and “9876543210”, or “01/11/2026” and “1 Nov 2026”.
- Duplicates within a single list, which can make counts confusing.
- Hidden characters such as non-breaking spaces copied from web pages or PDFs.
Method 1: the quick online way
For a one-off check, an online comparer is fastest because there are no formulas to write.
- Open the free Text Line Comparer.
- Paste the first list into the left box and the second into the right box, one item per line.
- Tick Ignore case if “Pune” and “pune” should match. Trim spaces and Skip empty lines are on by default and handle most stray spaces and blank lines.
- Click Compare to see which lines appear only in List A, only in List B, and in both.
- Copy whichever result you need.
The comparison runs in your browser, so the lists are not uploaded. It matches whole lines, so formatting differences inside a line (such as two ways of writing a phone number) still need the cleaning step above.
Method 2: Excel
Suppose List A is in column A (A2:A500) and List B is in column B (B2:B500).
Mark items in A that are missing from B
In C2, enter:
=IF(COUNTIF($B$2:$B$500, A2)=0, "Only in A", "In both")
Fill the formula down. COUNTIF counts how many times the value from column A appears in column B; zero means it is missing.
Mark items in B that are missing from A
In D2, enter:
=IF(COUNTIF($A$2:$A$500, B2)=0, "Only in B", "In both")
Get a clean list with FILTER (Excel 365 and Excel 2021)
=FILTER(A2:A500, COUNTIF(B2:B500, A2:A500)=0)
This spills a list of every item in A that is not in B, with no helper column.
Highlight differences with colour
- Select A2:A500.
- Go to Home → Conditional Formatting → New Rule → Use a formula.
- Enter
=COUNTIF($B$2:$B$500, A2)=0and choose a fill colour.
Every item in A that is missing from B is now highlighted.
Method 3: Google Sheets
The same COUNTIF formulas work in Google Sheets. Sheets also makes the filtered version easy in every edition:
=FILTER(A2:A, COUNTIF(B2:B, A2:A)=0)
For items that appear in both lists:
=FILTER(A2:A, COUNTIF(B2:B, A2:A)>0)
Add UNIQUE() around either formula to remove duplicates from the result, for example =UNIQUE(FILTER(A2:A, COUNTIF(B2:B, A2:A)=0)).
To ignore stray spaces, wrap values in TRIM() before comparing, or create cleaned helper columns with =TRIM(A2). Note that COUNTIF is not case sensitive in either Excel or Google Sheets, so “Pune” and “pune” are treated as the same.
Which method to choose
| Situation | Best method |
|---|---|
| Quick one-time check of two pasted lists | Online Text Line Comparer |
| Lists already in a spreadsheet with other columns | COUNTIF helper column |
| You need a separate, clean result list | FILTER with COUNTIF |
| You want to see differences in place | Conditional formatting |
| Very large datasets or repeated jobs | A database query or a script |
Common mistakes
- Comparing whole rows instead of a key. Compare a unique identifier, such as an email address or product code, not a full name that may be written differently.
- Forgetting absolute references. Without the
$signs, the range shifts as you fill the formula down and results become wrong. - Numbers stored as text. “1001” as text and 1001 as a number do not always match. Make the column formats consistent.
- Ignoring duplicates. If an item appears twice in A and once in B, decide whether that counts as a difference.
Frequently asked questions
Can I compare lists that are in a different order?
Yes. All the methods above check whether each item exists anywhere in the other list, so order does not matter.
How do I compare lists in Word or a text file?
Copy the items so there is one per line, then paste them into the Text Line Comparer.
How do I count how many items are different?
Use =SUMPRODUCT(--(COUNTIF(B2:B500, A2:A500)=0)) in Excel or Sheets to count items in A that are missing from B.


