To compare two lists in Excel, put each list in its own column on the same sheet, then use a formula that checks whether each value in the first list appears in the second. The quickest working setup is =COUNTIF(B:B, A2) next to the first list: a result of 1 or more means the value exists in the other list, and 0 means it does not. From there you can filter, sort, or highlight the mismatches. You do not need add-ins, macros, or Power Query for a straightforward comparison.
What You'll Need
- Excel on Windows, Mac, or the web version (the formulas below work in all three).
- Both lists in the same workbook. They can be on the same sheet in separate columns or on two different sheets.
- One clean header row per list, with no blank rows in the middle of the data.
- Consistent formatting: no leading or trailing spaces, and matching case is not required for COUNTIF but spelling is.
Menu labels and ribbon locations can differ slightly by Excel version, platform, and region, so treat the exact wording below as a guide rather than a fixed script.
Step-by-Step
- Lay out the lists. Put List 1 in column A starting at A2 and List 2 in column B starting at B2, each with a header in row 1. If the lists are on separate sheets, note the sheet name (for example, Sheet2) because you will reference it in the formula.
- Add a helper column. In C1 type a header such as In List 2?. This column will hold the comparison result for every row of List 1.
- Enter the COUNTIF formula. In C2 type
=COUNTIF(B:B, A2)and press Enter. This counts how many times the value in A2 appears anywhere in column B. A result above zero means the item is in both lists; zero means it is only in List 1. - Fill the formula down. Select C2, grab the small square at the bottom-right corner of the cell (the fill handle), and drag it down to the last row of List 1. Alternatively, double-click the fill handle and Excel will fill to the end of the adjacent data.
- Read the results. Filter column C using Data > Filter and choose 0 to see items missing from List 2, or choose values above 0 to see matches.
- Compare the other direction if needed. To find items in List 2 that are missing from List 1, add a second helper column in D and use
=COUNTIF(A:A, B2), then fill it down alongside List 2. Comparing both directions matters because COUNTIF only checks one list against the other. - Make it readable. Wrap the formula in IF to turn numbers into words:
=IF(COUNTIF(B:B, A2)>0, "Match", "Missing"). This is easier to scan and to filter than raw counts. - Highlight differences visually (optional). Select the range you want to colour, go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format, and enter a rule such as
=COUNTIF($B:$B, $A2)=0. Choose a fill colour and click OK. Rows unique to List 1 will be shaded. - Handle duplicates deliberately. If a value appears twice in List 2, COUNTIF returns 2, not 1. That is correct behaviour but can confuse a quick read. Use the IF version above if you only care whether a match exists, or use
=IF(COUNTIF(B:B, A2)>0, "Yes", "No")to collapse duplicates into a single answer. - Clean the data before trusting the result. Select each list, use Find & Select > Replace to remove stray spaces (search for a space and replace with nothing only if spaces are genuinely unwanted), and check that numbers stored as text are not being compared against real numbers. A quick test is to select the column and look at the status bar: it shows a count of numeric cells, which will be lower than the row count if some values are text.
Common Mistakes
- Mismatched ranges. Writing
=COUNTIF(B2:B100, A2)but filling down past row 100 means later rows compare against an empty range and return 0 even when a match exists. Use whole-column references (B:B) or lock the range with dollar signs ($B$2:$B$100). - Trailing spaces. "Apple " and "Apple" look identical on screen but count as different values. This is the single most common cause of false mismatches.
- Numbers stored as text. A number imported from a CSV may sit in the cell as text, so 1001 and "1001" will not match. Convert with Text to Columns or by multiplying by 1 in a helper cell.
- Comparing only one direction. A COUNTIF in one column tells you what List 1 is missing from List 2, not the reverse. Run both directions if the goal is a true difference.
- Forgetting case sensitivity. COUNTIF is not case-sensitive, so "apple" and "APPLE" match. If case matters, use
=IF(SUMPRODUCT(--EXACT(B:B, A2))>0, "Match", "Missing")instead. - Filtering the wrong column. After filtering, copy results to a new location rather than deleting rows in place, or you will lose the original data.
Tips
- Name your ranges (Formulas > Define Name) so formulas read as
=COUNTIF(List2, A2)instead of cryptic cell references. - Use Excel Tables (select the data, then Insert > Table) so helper formulas fill automatically as rows are added.
- For a fast visual check without formulas, select both columns and use Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. Values unique to one list stay unshaded.
- If you need a true set difference across large lists, Power Query (Data > Get Data) can merge two tables and return only the rows that do not match, which scales better than thousands of COUNTIF formulas.
- Keep a copy of the original sheet before you start filtering or deleting, so you can always return to the raw data.
Troubleshooting
- Every result is 0. Check that the range in COUNTIF points at the correct column and sheet. If the second list is on another sheet, the reference must include the sheet name, for example
Sheet2!B:B. - Formula shows as text. The cell may be formatted as Text. Change the format to General (Home > Number Format) and re-enter the formula; pressing F2 then Enter also re-evaluates it.
- #NAME? error. Usually a misspelled function name or a missing quote around text values. Check that COUNTIF and IF are spelled correctly and that text arguments are in double quotes.
- Matches appear that should not. Look for partial matches caused by wildcards or by values that are substrings of each other. Confirm with EXACT if you need a strict comparison.
- Results change when you sort. Relative references shift when rows move. Convert the helper column to values (copy, then Paste Special > Values) before sorting if you need the results to stay fixed.
- Large lists are slow. Whole-column references on very large sheets can be sluggish. Switch to a bounded range such as
$B$2:$B$5000.
Frequently Asked Questions
Can I compare two lists in different workbooks?
Yes. Reference the other workbook in the formula, for example =[Book2.xlsx]Sheet1!$B:$B. Both files must be open for the formula to calculate; if the other workbook is closed, Excel may show the last saved value or an error.
What is the difference between COUNTIF and VLOOKUP for this task?
Both work. COUNTIF simply tells you whether a value exists in the other list. VLOOKUP or XLOOKUP can also return a related value from the matched row, which is useful when the lists share a key column and you need extra data, not just a yes/no answer.
How do I compare lists and ignore case?
COUNTIF already ignores case, so "Apple" and "apple" count as a match. If you want case-sensitive comparison, use SUMPRODUCT with EXACT as shown in the Common Mistakes section.
Can I compare more than two lists at once?
Yes, but add one helper column per list. Each column uses COUNTIF against a different range, and you can then combine them with AND or COUNTIF to see which values appear in all lists. Keeping each comparison in its own column makes errors much easier to spot.
Why does my formula return a number greater than 1?
That value appears more than once in the second list. COUNTIF counts occurrences, not unique matches. Wrap it in IF with a greater-than-zero test if you only need a yes or no.
Does this work in Excel for the web and on Mac?
Yes. COUNTIF, IF, conditional formatting, and filters are available in Excel for the web, Excel for Mac, and Excel for Windows. The ribbon location of Conditional Formatting is the same, though some dialogs look slightly different across platforms.