How to Use the Google Sheets IF OR Function (The Right Way!)

In this article, I’m going to show you the perfect way to use the IF OR function in Google Sheets. By combining the functionalities of the IF and OR functions, you can create an IF OR statement that is valid even if only one of the conditions is met. You can use numerical and text conditions, or even combine them, to help you identify the entries you need.

Syntax of the Google Sheets IF OR Function

The syntax of the IF OR formula is as follows:

=IF(OR(condition1, condition2, ...), value_if_true, value_if_false)

Where:

  • condition1 and condition2 are the conditions to be met, but you can define more than two.
  • value_if_true is the value displayed if any of the conditions are met.
  • value_if_false is the value displayed if none of the conditions are met.

Examples of the Google Sheets IF OR Function

IF OR with Numerical Conditions

Step 1: Identify the numerical conditions.

In this example, we identify the following conditions and the corresponding values to display:

  • condition1: The population of 2020 is greater than 500,000.
  • condition2: The population density of 2020 is greater than 5,000.
  • value_if_true: “very high density”.
  • value_if_false: “high density”.

Step 2: Insert the formula =IF(OR(condition1, condition2, ...), value_if_true, value_if_false).

For our example, the formula is as follows:

=IF(OR(C2>500000,E2>5000),"very high density","high density")

Step 3: Press Enter.

You can extend the IF OR function throughout the column to obtain the following output:

Function added as new column

IF OR with Text Conditions

Step 1: Identify the text conditions.

In this example, we identify three conditions and the corresponding values to display:

  • condition1: The city is located in New York.
  • condition2: The city is located in California.
  • condition3: The city is located in Texas.
  • value_if_true: “very high population”.
  • value_if_false: “high population”.

Step 2: Insert the formula =IF(OR(condition1, condition2, ...), value_if_true, value_if_false).

The formula is as follows:

=IF(OR(B2="New York",B2="California",B2="Texas"),"very high population","high population")

Step 3: Press Enter.

You can extend the IF OR function throughout the column to obtain the following output:

Function added as new column

IF OR with Text and Numerical Conditions

Step 1: Identify the conditions.

In this example, we identify the following conditions and corresponding values to display:

  • condition1: The city is located in California.
  • condition2: The population is greater than 200,000.
  • value_if_true: “major city or in California”.
  • value_if_false: “not a major city or not in California”.

Step 2: Insert the formula =IF(OR(condition1, condition2, ...), value_if_true, value_if_false).

The formula is as follows:

=IF(OR(B2="California",C2>200000),"major city or in California","not a major city or not in California")

Step 3: Press Enter.

You can extend the IF OR function throughout the column to obtain the following output:

Function added as new column

Frequently Asked Questions

How many conditions should I use?

Ideally, there is no limit to the number of conditions you can add, but the limits come from the conditional logic you want to implement. This usually limits it to 2-3 conditions.

Can complete conditions be stored in another cell?

No, but you can reference other cells when defining the conditions.

Can I see the spreadsheet example?

Of course, click here to access the spreadsheet example.

Other related IF functions

  • IF: Allows you to check specific conditions in a data set.
  • SUMIF: Sum numbers if they meet certain conditions.
  • SUMIFS: Sum data from cells that meet multiple criteria.
  • COUNTIF: Count data if it meets certain criteria.
  • COUNTIFS: Count data that meets two or more criteria.
  • COUNTIFNONBLANK: Count cells if they contain data.
  • IFMULTIPLE: Evaluate data against multiple criteria in a more elegant way.
  • IFERROR: Allows you to return values when a formula generates an error.
  • IFTHEN: Allows you to write statements based on an IF X Then Y logic.
  • IFAND: Combines the functionalities of the IF and AND functions.
  • IFELSE: Sets conditions that return an output based on the fulfillment of a given condition or not.
  • Multiple IF statements: How to chain multiple statements.
  • IFCONTAINS: Returns cells that contain specific text.
  • AVERAGEIF: Calculates an average for numbers in a range of data if they meet specified criteria.

Use our vacation tracking software to easily set up personalized reminders from your spreadsheet in just a few clicks.

If you want to learn how to create an email address list in Google Sheets, I also recommend checking out our detailed guide.

Article translated from the original English “How to Use the Google Sheets IF OR Function (The Right Way!)” on Crawlan.com

Related posts