Check If Value Exists in Range in Excel and Google Sheets
Check If Value Exists in Range in Excel and Google Sheets
In this article, we will explore the most commonly used formulas in Excel and Google Sheets to check if a
value exists in a column, row, or within a range of cells.
Whether you're an experienced user or just starting to learn about your favorite spreadsheet
program, knowing how to quickly identify if a speci�c value is present or absent in a given range can
save much time and e�ort in your data analysis. This can be particularly useful when working with
large datasets or when conducting research. In Microsoft Excel and Google Sheets, there are several
formulas to perform this task. With our step-by-step guide, you can easily apply them to your
spreadsheets, regardless of the structure and size of your dataset.
In this formula, COUNTIF counts the occurrences of a given value in a range. If the count is greater
than zero, the IF statement returns "Yes". If the value is not found within the range, the COUNTIF
1 of 8 2/15/2025, 2:39 PM
Firefox https://www.ablebits.com/office-addins-blog/if-value-exists-in-range-ex...
Please pay attention that we lock the range reference ($A$3:$A$20) by using the $ sign for the formula
to copy correctly in cells D4:D7:
2 of 8 2/15/2025, 2:39 PM
Firefox https://www.ablebits.com/office-addins-blog/if-value-exists-in-range-ex...
3 of 8 2/15/2025, 2:39 PM
Firefox https://www.ablebits.com/office-addins-blog/if-value-exists-in-range-ex...
The MATCH function returns the position of the lookup value (C3) within the range (A3:A20) as a
number; an #N/A error if no match is found. The ISNUMBER function converts a number to TRUE and
an error to FALSE. Wrapping the construction into IF gives "Yes" or "No" as the �nal result.
Here, the VLOOKUP function searches for the lookup value is the speci�ed array and returns an exact
match (FALSE) from the same column (1). If no match is found, an #N/A error is returned. (In Excel 365
and Excel 2021, you can use XLOOKUP instead of VLOOKUP.) The ISNA function checks the result for
#N/A errors and returns TRUE if positive, FALSE otherwise. Finally, the IF function returns "No" for
TRUE (no match) and "Yes" for FALSE (match).
4 of 8 2/15/2025, 2:39 PM
Firefox https://www.ablebits.com/office-addins-blog/if-value-exists-in-range-ex...
For more information, please see How to use ISNA with VLOOKUP in Excel.
Tip. If you goal is to �nd a lookup value in one column and return a matching value from another
column, then use the VLOOKUP or XLOOKUP function in its basic form.
For instance, to �nd whether the value in D3 occurs in the range A3:B11, the formula in E4 is:
5 of 8 2/15/2025, 2:39 PM
Firefox https://www.ablebits.com/office-addins-blog/if-value-exists-in-range-ex...
You can �nd a few more formulas in our sample spreadsheet, which is available at the end of this
tutorial.
For example, the bellow formula will check if any cell in the range A3:B11 contains the word "apple":
If you are referring to a certain cell instead of a hardcoded value, then concatenate asterisks before
and after the cell reference like this:
1. Select the cells with values that you want to �nd in a range (C3:C7 in our case).
6 of 8 2/15/2025, 2:39 PM
Firefox https://www.ablebits.com/office-addins-blog/if-value-exists-in-range-ex...
2. On the Home tab, in the Styles group, click Conditional Formatting > New Rule.
3. In the New Formatting Rule window, select Use a formula to determine which cells to format.
4. Enter one of these formulas in the Format values where this formula is true box:
=MATCH(C3, $A$3:$A$20, 0)
=COUNTIF($A$3:$A$20, C3)>0
Where C3 is the topmost cell with the target values and $A$3:$A$20 is the range to check.
Done! All the values that exist in the range (exact match) are highlighted:
To highlight partially matching values, modify the formula like shown below - concatenate an asterisk
7 of 8 2/15/2025, 2:39 PM
Firefox https://www.ablebits.com/office-addins-blog/if-value-exists-in-range-ex...
=MATCH("*"&C3&"*", $A$3:$A$20, 0)
=COUNTIF($A$3:$A$20, "*"&C3&"*")>0
Tip. The same formula can be used with Google Sheets Conditional Formatting to highlight exact or
partial matches in a range in Google spreadsheets.
Now you are equipped with the knowledge and skills to check if a value exists in a column, row or
range with con�dence and ease. Thank you for reading!
8 of 8 2/15/2025, 2:39 PM