How can I use the IF Statement with the MATCH Function in Google Sheets?

The IF statement and MATCH function can be used together in Google Sheets to create a logical test that checks if a certain condition is met, and if so, returns a corresponding value from a specific range of cells. The MATCH function is used to search for a specific value within a range and returns its position, while the IF statement evaluates a given condition and returns a result based on whether the condition is true or false. By combining these two functions, you can create more complex and dynamic formulas in your Google Sheets that can automatically return different values based on the results of the MATCH function.


You can use the following syntax in Google sheets to use an IF statement with the MATCH function:

=IF(ISNUMBER(MATCH(D2,A2:A11,0)), "Yes", "No")

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

If it does exist, then the formula returns Yes.

If it does not exist, then the formula returns No.

Note: Feel free to replace “Yes” and “No” with whatever other values you’d like to return.

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

Example: How to Use IF Statement with MATCH Function in Google Sheets

Suppose we have the following dataset in Google Sheets that contains information about various basketball players:

Suppose we would like to check if the team name Lakers exists in the team column.

We can type the following formula into cell E2 to do so:

=IF(ISNUMBER(MATCH(D2,A2:A11,0)), "Yes", "No")

The following screenshot shows how to use this formula in practice:

Google Sheets IF Match formula

The team name Lakers does exist in the range A2:A11 so the formula returns “Yes” in cell E2.

Note that you could also return a cell value instead of “Yes” or “No” in the IF statement.

=IF(ISNUMBER(MATCH(D2,A2:A11,0)), D2, " ")

The following screenshot shows how to use this formula in practice:

The formula simply returns the name Lakers in cell E2 because this name existed in the team column.

Additional Resources

The following tutorials explain how to perform other common operations in Google Sheets:

x