<link rel="stylesheet" type="text/css" href="/mirawhite.css">

How to compare two lists in Excel

Updated November 24, 2026

With list A in column A and list B in column C, type =COUNTIF($C$2:$C$500,A2)>0 next to the first value and fill it down: TRUE means the value is in both lists, FALSE means it is missing from list B. To color the matches instead, use the same formula in a conditional formatting rule. The method works in every Excel version and in Google Sheets.

Find matches with COUNTIF

COUNTIF counts how many times a value appears in a range. If the count is above zero, the value of list A also exists in list B. The examples below assume list A in A2:A500 and list B in C2:C500.

  1. Click B2, the cell next to the first value of list A.
  2. Type the formula below and press Enter.
  3. Double-click the small square at the bottom right of B2 to fill the formula down the whole list.
  4. Select the header row and turn on Data > Filter, then filter column B on FALSE to see the values missing from list B.
=COUNTIF($C$2:$C$500,A2)>0

Good to know : To check the other direction, put =COUNTIF($A$2:$A$500,C2)>0 next to list B. Without the >0 at the end, the formula returns the number of matches, which also reveals values that appear several times.

Highlight matches or differences with conditional formatting

  1. Select list A, from A2 to the last value.
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose “Use a formula to determine which cells to format”.
  4. Enter =COUNTIF($C$2:$C$500,A2)>0 to color matches, or =COUNTIF($C$2:$C$500,A2)=0 to color the values missing from list B.
  5. Click Format, pick a fill color on the Fill tab, then click OK twice.

Good to know : For a quick look, select both columns and use Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. Values present in both lists are colored, but so are values repeated inside one list, so use the formula rule when your lists contain repeats.

Compare two lists on different sheets

The formulas are the same: only the range changes. While typing the formula, click the other sheet tab and select the range, and Excel writes the reference for you. If the sheet name contains spaces, Excel wraps it in single quotes, as in 'Customer list'!$A$2:$A$500.

Conditional formatting rules can point to another sheet in Excel 2010 and later, so the rule from the previous section works across sheets too.

=COUNTIF(Sheet2!$A$2:$A$500,A2)>0

Bring back data from the other list: XLOOKUP, VLOOKUP, MATCH

When you need more than yes or no, for example the price or the status stored next to each value of list B, use a lookup function. Here list B sits in C2:C500 and the data to return in D2:D500.

  • XLOOKUP, in Excel 2021, Excel 2024, Microsoft 365 and Google Sheets: =XLOOKUP(A2,$C$2:$C$500,$D$2:$D$500,"Not found").
  • VLOOKUP, in every version: =IFERROR(VLOOKUP(A2,$C$2:$D$500,2,FALSE),"Not found"). The FALSE argument forces an exact match; without it, results are wrong on an unsorted list.
  • MATCH: =ISNUMBER(MATCH(A2,$C$2:$C$500,0)) returns TRUE or FALSE like COUNTIF, and MATCH alone returns the position of the value in list B.

Compare two tables or two columns row by row

If both columns are aligned, for example last month and this month for the same products, compare each row directly: =A2=B2 returns TRUE when the values match, ignoring case, and =EXACT(A2,B2) also checks capitals. You can also select both columns and use Home > Find & Select > Go To Special > Row differences to select every cell that differs from its neighbor.

For two tables in a different order, build a key that joins the columns to compare, such as =A2&"|"&B2&"|"&C2, in both tables, then compare the keys with COUNTIF. In Excel 2021, 2024 and Microsoft 365, FILTER lists the differences in one go:

=FILTER(A2:A500,COUNTIF(C2:C500,A2:A500)=0)

Good to know : This returns every value of list A that is missing from list B. Replace =0 with >0 to list the values in both lists. Fit the ranges to your data, otherwise empty cells can show up in the result as 0.

Compare two lists in Google Sheets

COUNTIF, MATCH, VLOOKUP, XLOOKUP and FILTER work the same way in Google Sheets. To highlight matches, select list A, go to Format > Conditional formatting, choose “Custom formula is” under Format rules and enter =COUNTIF($C$2:$C$500,A2)>0.

A conditional formatting rule in Sheets cannot point straight to another sheet. Wrap the range in INDIRECT instead:

=COUNTIF(INDIRECT("List2!A2:A500"),A2)>0

Common problems

  • A value looks identical but is not found: one list has a trailing space or a non-breaking space copied from the web. Clean both lists with =TRIM(A2), or with SUBSTITUTE(A2,CHAR(160),"") for non-breaking spaces.
  • VLOOKUP or MATCH returns #N/A for numbers that match: one list holds real numbers and the other numbers stored as text. Convert them with the warning icon > Convert to Number.
  • Results shift when you fill the formula down: the $ signs are missing, so the range of list B moves with each row. Use $C$2:$C$500.
  • COUNTIF treats * and ? as wildcards, so a value containing them can match other values. All these functions also ignore case; use EXACT when capitals matter.

Compare two lists online with Utiloz

If you only need the result, paste each list into Compare two lists on Utiloz, one value per line. You get four lists at once: only in A, only in B, in both, and the union without duplicates, each with its count and a copy button. Case is ignored by default, and you can also ignore all spaces or accents.

Everything runs in your browser, with no upload and no sign-up, so customer lists or email addresses stay on your device. The comparison works line by line: a line holding “Anna, Ben” is one value, so paste a single column per list. Each result lists a value once, even if it appears several times.

Frequently asked questions

How do I compare two lists in Excel and highlight matches?

Select list A, go to Home > Conditional Formatting > New Rule > Use a formula, and enter =COUNTIF($C$2:$C$500,A2)>0 with list B in column C. Every value of list A that also appears in list B gets the color you chose.

How do I compare two lists in Excel for matches on different sheets?

Point the range to the other sheet: =COUNTIF(Sheet2!$A$2:$A$500,A2)>0 returns TRUE when the value of A2 appears on Sheet2. The same formula works in a conditional formatting rule in Excel 2010 and later.

Can I use VLOOKUP to compare two columns?

Yes: =IFERROR(VLOOKUP(A2,$C$2:$C$500,1,FALSE),"Missing") returns the value when it exists in column C and “Missing” otherwise. Always use FALSE as the last argument for an exact match.

How do I find the differences between two columns row by row?

Type =A2<>B2 in a third column and fill it down: TRUE marks the rows that differ. Go To Special > Row differences selects those cells directly, so you can color them.

← All guides