FormulaCraft

How to find common values between two lists in Excel and Google Sheets

Topic:Duplicates & uniqueness
Excel & Google Sheets
=IF(COUNTIF($B$2:$B$6,A2)>0,"In Both","")

Verified example

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

List AList BCommon?
AppleBanana
BananaCherry
CherryApple
DateFig
ElderberryBanana

=IF(COUNTIF($B$2:$B$6,A2)>0,"In Both","")In Both

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, enter =IF(COUNTIF($B$2:$B$6,A2)>0,"In Both","") — a non-empty result means the value exists in both lists.
  2. 2Copy down all rows in List A.
  3. 3Filter the helper column for 'In Both' to extract the common values, or use COUNTIF without IF to see how many times each value appears in List B.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

How do I count the total number of common values?

Use SUMPRODUCT: =SUMPRODUCT((COUNTIF(B2:B6,A2:A6)>0)*1) — this counts how many items in List A also appear in List B.

What if a value appears multiple times in each list?

COUNTIF returns the count from List B, so >0 correctly marks it as common regardless of how many duplicates exist.

More on Duplicates & uniqueness

See all →

Formulas used

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

Last reviewed: