How to Combine the IF and OR Functions in Google Sheets


You can use the following basic syntax to use the IF and OR functions together in Google Sheets to determine if some cell meets one of multiple criteria:

=IF(OR(A2="String", B2>10), "value1", "value2")

If the value in cell A2 is equal to “String” or if the value in cell B2 is greater than 10, then we return value1, otherwise we return value2.

Note that we can use as many logical comparisons as we’d like within the OR function.

The following examples show how to use this syntax in practice.

Example 1: Combine IF and OR Functions with String Comparisons

Suppose we have a column that contains the names of NBA teams and we’d like to determine if each team is based in Texas:

Note that the only teams that are based in Texas are the Mavs, Rockets, and Spurs.

We can use the following formula with the IF and OR functions to determine if each team is based in Texas:

=IF(OR(A2="Mavs", A2="Rockets", A2="Spurs"), "Yes", "No")

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

If a given team is from Texas, we return a value of “Yes”, otherwise we return “No.”

Example 2: Combine IF and OR Functions with Numeric Comparisons

Suppose we have columns that contain the number of points and assists for various basketball players and we’d like to classify each player as “Good” or “Bad.”

Let’s say that if a player has more than 20 points or more than 10 assists, we will classify them as “Good”, otherwise we’ll classify them as “Bad.”

We can use the following formula with the IF and OR functions to determine if each player should be classified as “Good” or Bad”:

=IF(OR(A2>20, B2>10), "Good", "Bad")

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

IF and OR function in Google Sheets

If a given player has more than 20 points or more than 10 assists, we classify them as “Good.”

Otherwise we classify them as “Bad.”

Additional Resources

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

How to Use COUNTIF with Multiple Ranges in Google Sheets
How to Use SUMIF with Multiple Columns in Google Sheets
How to Sum Across Multiple Sheets in Google Sheets

Leave a Reply

Your email address will not be published.