30 Advanced Excel Tips for 2026

Excel Champs / Excel Formulas List / Check IF a Value Exists in a Range (Formula in Excel)
By Puneet Gogia (Microsoft MVP)

Check IF a Value Exists in a Range (Formula in Excel)

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

To check whether a value exists in a range, count it and test the count: =IF(COUNTIF(A1:A10,"Glen")>0,"Yes","No"). COUNTIF returns how many times the value appears, and IF turns any number above zero into your own message.

To check against a value in a cell rather than typed text, drop the quotes: =IF(COUNTIF(A1:A10,C1)>0,"Yes","No"). For a partial match, wrap the value in asterisks so it matches anywhere inside the cell: =IF(COUNTIF(A1:A10,"*Glen*")>0,"Yes","No") finds “Glen Smith” as well as “Glen”.

Two alternatives worth knowing: =IF(ISNUMBER(MATCH(C1,A1:A10,0)),"Yes","No") does the same job and is faster on large ranges, and =COUNTIF(A1:A10,C1)>0 on its own returns a plain TRUE or FALSE if you don’t need custom text. If it returns “No” when the value is clearly there, the cause is almost always a trailing space or a number stored as text — check with =COUNTIF(A1:A10,TRIM(C1)).

In Excel, to check if a value exists in a range or not, you can use the COUNTIF function with the IF function. With COUNTIF, you can check for the value, and with IF, you can return a result value to show to the user, i.e., Yes or No, Found or Not Found.

Check IF Value Exists In A Range / Excel Formula

Check for a Value in a Range

In the following example, you have a list of names that only includes first names, and now you need to check if “Glen” is there.

list-of-names

You can use the following steps:

  1. First, you need to enter the IF function in cell B1.
    enter-the-if-function
  2. After that, in the first argument (logical test), you need to enter the COUNTIF function there.
    enter-the-count-if-function
  3. Now, in the COUNTIF function, refer to the range A1:A10.
    refer-to-a-range
  4. Next, in the criteria argument, enter “Glen” and close the parentheses for the COUNTIF Function.
    close-the-prentheses
  5. Additionally, use a greater than sign and enter a zero.
    use-greater-than-sign
  6. From here, enter a comma to go to the next argument in the IF, and enter “Yes” in the second argument.
    next-argument-in-if
  7. In the end, enter a comma and enter “No” in the third argument and type the closing parentheses.
    type-the-closing-prantheses

The moment you hit Enter, it returns “Yes”, as you have the value in the range that you have searched for.

returns-the-value
=IF(COUNTIF(A1:A10,"Glen")>0,"Yes","No")

Instead of typing the value in the formula, you can also refer to a cell that has the value you want to look for. In the following formula, the value is in cell C1:

=IF(COUNTIF(A1:A10,C1)>0,"Yes","No")

How This Formula Works

This formula has two parts.

if-countif-formula

In the first part, we have COUNTIF, which counts the occurrences of the value in the range. In the second part, you have the IF function that takes the value from the COUNTIF function.

So, if COUNTIF returns any value greater than 0, it means the value is in the range, and IF returns Yes. If COUNTIF returns 0, it means the value is not in the range, and it returns No.

Note that COUNTIF isn’t case-sensitive, so “Glen”, “GLEN” and “glen” are all the same for it.

Check for a Value in a Range Partially

There can be a situation where you want to check for a partial value in a range. In that case, you must use wildcard characters (asterisk *).

In the following example, we have the same list of names, but here we have full names. We still need to look for the name “Glen.”

check-value-in-range-partially

The value you want to search for must be enclosed with an asterisk, which we have used in the above example. This tells Excel to check for the value “Glen” regardless of what is before and after it.

=IF(COUNTIF(A1:A10,"*Glen*")>0,"Yes","No")

Keep in mind that a partial match also finds the value inside other words, so “*Glen*” matches “Glenda” as well. Use “Glen *” (with a space) if you only want names that start with the word Glen.

Check for a Value with MATCH

Another way is to use MATCH with ISNUMBER. MATCH returns the position of the value in the range, or the #N/A error when it’s not there. ISNUMBER turns that into TRUE or FALSE:

=ISNUMBER(MATCH("Glen",A1:A10,0))

The 0 in the last argument makes MATCH look for an exact match. You can wrap this formula in IF, just like COUNTIF, to show Yes or No.

Check for a Value with a Case-Sensitive Match

As COUNTIF and MATCH ignore the case, use EXACT when the case matters. EXACT compares each cell in the range with the value, and SUMPRODUCT counts the exact matches. In the following formula, “Glen” isn’t found if the list has only “GLEN”:

=IF(SUMPRODUCT(--EXACT(A1:A10,"Glen"))>0,"Yes","No")

Frequently Asked Questions

Why does COUNTIF not find a value that is in the range?

The most common reason is extra spaces, like “Glen ” with a space at the end. Check the length of the cell with LEN, or clean the data with TRIM. Also, COUNTIF can’t match text longer than 255 characters.

How do I highlight the value if it exists in the range?

Use conditional formatting with a formula rule (Home ➜ Conditional Formatting ➜ New Rule ➜ Use a formula), and use the COUNTIF part of the formula as the rule, like COUNTIF($A$1:$A$10,C1)>0.

Yes. Use a lookup function like XLOOKUP (Microsoft 365 and Excel 2021) or VLOOKUP to return a value from the same row when the value is found.

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel

3 thoughts on “Check IF a Value Exists in a Range (Formula in Excel)”

  1. Great info, thank you. It is just my excel uses “;” as a separator instead of “,” , so copying the code didn’t worked, I had to write it and autocomplete showed ;

    Reply
  2. You start the problem statement with searching for Arlene, but then move to Glen. Slightly confusing…

    Reply

Leave a Comment