FormulaCraft

How to compare two lists for differences in Excel and Google Sheets

Topic:Duplicates & uniqueness
Excel & Google Sheets
=IF(COUNTIF($B$2:$B$6,A2)=0,"Not in List B","Matched")

Verified example

Computed by a real spreadsheet engine on the sample data below.

List AList BStatus A
AppleApple
BananaCherry
CherryMango
DateBanana
ElderberryFig

=IF(COUNTIF($B$2:$B$6,A2)=0,"Not in List B","Matched")Matched

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1In a helper column beside List A (e.g., C2) enter =IF(COUNTIF($B$2:$B$6,A2)=0,"Not in List B","Matched").
  2. 2Copy the formula down all rows in List A to check every item.
  3. 3Repeat with a second helper column beside List B to find values in B that are missing from A: =IF(COUNTIF($A$2:$A$6,B2)=0,"Not in List A","Matched").

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Is the comparison case-sensitive?

No — COUNTIF is case-insensitive. Use EXACT inside a SUMPRODUCT if case sensitivity matters: =IF(SUMPRODUCT(--(EXACT($B$2:$B$6,A2)))=0,"Not Found","Matched").

How do I compare lists of different lengths?

Expand the COUNTIF range to the full length of the longer list, or use a named range for each list — the formula still works correctly.

More on Duplicates & uniqueness

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: