13.4 C
London
Tuesday, May 13, 2025
HomeSoftware TutorialsExcelExcel: Search for Value in List and Return Yes or No

Excel: Search for Value in List and Return Yes or No

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

You can use the following basic syntax to check if a value in a cell exists in a list in Excel and return either “Yes” or “No” as a result:

=IF(COUNTIF($A$2:$A$14, D2)>0,"Yes","No")

This particular formula checks if the value in cell D2 exists in the range A2:A14.

If the value does exist in the range, then the formula returns “Yes” as a result.

Otherwise, the formula returns “No” as a result.

The following example shows how to use this formula in practice.

Example: Search for Value in List and Return Yes or No in Excel

Suppose we have the following two lists of basketball players in Excel:

Suppose we would like to determine whether or not each player in List B exists in List A.

To do so, we can type the following formula into cell E2:

=IF(COUNTIF($A$2:$A$14, D2)>0,"Yes","No")

We can then click and drag this formula down to each remaining cell in column E:

The formula returns either “Yes” or “No” for each player in List B.

For example, we can see:

  • Harry does exist in List A.
  • Mark does not exist in List A.
  • Chad does exist in List A.
  • John does exist in List A.

And so on.

Note: If you’d like to return values other than “Yes” and “No”, simply replace these values in the formula with whatever values you’d like.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

Excel: How to Write a Case Statement
Excel: How to Find Unique Values from Multiple Columns
Excel: How to Match Two Columns and Return a Third

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories