
To check if a specific value occurs in a 2D range, supply the corresponding range reference to the first argument of COUNTIF. =IF(COUNTIF($B$2:$I$2, B5)>0, "Yes", "No") Check if value exists in a range To find out if a value in B5 appears in the row B2:I2, the formula takes this form: 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: To test if a value in C3 is present in column A (more precisely in the range A3:A20), you can use this formula:

This generic formula works nicely in all possible scenarios. If the value is not found within the range, the COUNTIF function brings zero, and IF outputs "No". If the count is greater than zero, the IF statement returns "Yes". In this formula, COUNTIF counts the occurrences of a given value in a range. IF(COUNTIF( range, value)>0, "Yes", "No")

This can be particularly useful when working with large datasets or when conducting research.

Whether you're an experienced user or just starting to learn about your favorite spreadsheet program, knowing how to quickly identify if a specific value is present or absent in a given range can save much time and effort in your data analysis. 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.
