You can use the following syntax in Excel to use an **IF** statement with the **MATCH** function:

=IF(ISNUMBER(MATCH(E2,A2:A10,0)), "Yes", "No")

This particular formula checks if the value in cell **E2** exists in the range **A2:A10**.

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 Excel**

Suppose we have the following dataset in Excel 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 **F2 **to do so:

=IF(ISNUMBER(MATCH(E2,A2:A10,0)), "Yes", "No")

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

The team name “Lakers” does exist in the range **A2:A10** so the formula returns “Yes” in cell **F2**.

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

For example, you could use the following formula to return the team name if it does exist in the team column or a blank otherwise:

=IF(ISNUMBER(MATCH(E2,A2:A10,0)), E2, " ")

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

The formula simply returns the name “Lakers” in cell **F2** because this name existed in the team column.

**Additional Resources**

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

Excel: How to Use IF Function with INDEX MATCH

Excel: How to Use SUM with INDEX MATCH

Excel: Use INDEX and MATCH to Return Multiple Values Vertically