Can I write a Google Sheets formula to return “Yes” or “No” if there is a match?

Yes, it is possible to write a Google Sheets formula that will return a “Yes” or “No” based on whether or not there is a match. This can be done by using the IF function, which allows you to specify a logical test and provide different outcomes based on the result. By using the IF function and defining the logical test as a match between two sets of data, you can set the formula to return “Yes” if there is a match and “No” if there is no match. This can be useful for quickly identifying and categorizing data within a spreadsheet.

Google Sheets Formula: If Match then Return Yes or No


You can use the following formula in Google Sheets to return Yes or No to indicate whether or not a given cell has a matching value in another range:

=IF(ISNUMBER(MATCH(C2,$A$2:$A$12,0)), "Yes", "No")

This particular formula checks if the value in cell C2 exists in the range A2:A12.

If it does exist, then the formula returns Yes.

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

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

Example: If Match Then Return Yes or No in Google Sheets

Suppose we have a list of basketball teams in column A and we’d like to check if each specific team in column C belongs to the larger list in column A:

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

=IF(ISNUMBER(MATCH(C2,$A$2:$A$12,0)), "Yes", "No")

We can then click and drag this formula down to each remaining cell in column D:

Google Sheets if match then yes

Column D now returns “Yes” or “No” to indicate if each team in the Specific Teams list belongs in the All Teams list.

For example:

  • Thunder belongs in the All Teams list so the formula returns Yes.
  • Hornets does not belong in the All Teams list so the formula returns No.

And so on.

=IF(ISNUMBER(MATCH(C2,$A$2:$A$12,0)), "Yes", "")

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

If a team name in the Specific Teams list does not belong in the All Teams list, the formula now simply returns a blank value.

Additional Resources

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

x