OR Function In Google Sheets

What Is OR Function In Google Sheets?

The OR function in Google Sheets returns TRUE if at least one of the conditions is true and returns FALSE if all are false. As a built-in Logical function, the Google Sheets OR function can be combined with other functions such as IF() & AND(), to conduct efficient logical conditional tests.

For example, the table below has a list of fruits and the number of available boxes in the inventory and the store.

OR function in Google Sheet - Definition 1

We will check the availability of fruits using the OR formula in Google Sheets and update the status for each fruit. Therefore, select cell D2, enter the formula =OR(B2>0,C2>0), press “Enter” and drag the formula from cell C2 to C4, as shown below.

OR function in Google Sheet - Definition 1-1

The output is shown above. The OR function compares two conditions – whether the number of boxes in columns B or C is greater than 0. If one of the two conditions is TRUE, the status is TRUE; else, FALSE.

Key Takeaways
  • The OR function in Google Sheets helps the user compare multiple conditions simultaneously and returns TRUE or FALSE. It returns TRUE atleast if one of the conditions is TRUE, else it returns FALSE.
  • It assesses arguments and returns two logical values, TRUE or FALSE where the arguments can be references or arrays of logical value.
  • We can use the OR() with other Google Sheets functions involving logical evaluation, such as IF() and conditional formatting. The logical operator makes them highly efficient and more useful.
  • We must ensure to have valid cell values, otherwise, we may end up getting errors. We must also ensure to enter cell references and make them absolute by adding a “$” symbol to get accurate results. For example, the cell C8 when made absolute, becomes $C$8.

OR() Google Sheets Formula

The syntax of the OR Google Sheets formula is,

OR Formula

The arguments of the OR Google Sheets formula are,

  • logical_expresssion1: It is a mandatory argument and refers to the first logical value to be tested.
  • [logical_expresssion2, logical_expresssion3, ….]: It is an optional argument; it denotes the second or the corresponding logical value.

How To Use OR Google Sheets Function?

We can use the OR Google Sheets Function in 2 ways, namely,

  1. Access from the toolbar.
  2. Enter in the worksheet manually.

#Method 1 – Access from the toolbar

Choose an empty cell for output 🡪 select the “Insert” tab 🡪 click the “Function” option right arrow 🡪 click the “Logical” option right arrow 🡪 select the “OR” function, as shown below.

Access from the toolbar method 1

The OR formula appears as shown below.

OR formula 1

Select the argument values as cell references or cell rangeand press “Enter”.

#Method 2 – Enter in the worksheet manually

  1. Select an empty cell to display the output.
  2. Type =OR( in the chosen cell. [Alternatively, enter =O or =OR and click the OR function from the suggestions Google Sheets lists.]
OR formula 1

3. Enter the cell values or references as the argument values.

4. Close the brackets and press Enter to obtain the logical results in the target cells.

Examples

Let us consider the OR function in Google Sheets examples.

Example #1

Consider the below table with the subject scores of a student. We will check the following,

  • If the scores are greater than or equal to 90, then the output will be “TRUE”.
  • If the scores are less than 90, then the output will be “FALSE”.
OR function in Google Sheet - Example 1

The steps to use the Google Sheets OR function are as follows:

Step 1: Select cell C2 and enter the formula =or(B2>=90), as shown below.

OR function in Google Sheet - Example 1-1

Step 2: Next, press “Enter”. We will get the output as “True” as the selected cell value 95 is greater than 90, as shown below.

OR function in Google Sheet - Example 1-2

Step 3: Drag the formula from cell C2 to C11 using the fill handle. We will get the output shown below.

OR function in Google Sheet - Example 1-3

Example #2

Let us now understand the working of the OR formula with IF Google Sheets formula.

Below is a table of a company’s branch-wise profit and sales data. We will try to update the bonus status for each branch office in column E. The bonus status will be “APPROVED” if the specific branch has an operations team, the sales are over $5000, or the profit is more than $1000.

OR function in Google Sheet - Example 2

The steps to use OR() with IF() functions are as follows:

Step 1: Choose cell E2 and enter the formula =if(B2=”Yes”,if(or(C2>5000,D2>1000),”Approved”,”Not Approved”),”NA”), as shown below.

OR function in Google Sheet - Example 2-1

Step 2: Press “Enter.” We will get the output as “Approved,” as shown below.

OR function in Google Sheet - Example 2-2

Step 3: Now, drag the formula from cell E2 to E8 using the fill handle, as shown below.

OR function in Google Sheet - Example 2-3

Thus, we see that the OR function in Google Sheets with IF formula has returned the bonus status as APPROVED to those branch offices that satisfied at least one of the logical tests in the OR().

Similarly, we can use multiple OR functions in an IF() and IF() with OR and AND operations.

Example #3

We will consider an example using the OR() function from the toolbar. The data given below is a firm’s yearly sales. We will just confirm if the sales are more than $50,000.

OR function in Google Sheet - Example 3

The steps to insert the OR() function from the toolbar are as follows:

1: Choose cell C2 🡪 select the “Insert” tab 🡪 click the “Function” option right arrow 🡪 click the “Logical” option right arrow 🡪 select the “OR” function, as shown below.

OR function in Google Sheet - Example 3-1

2: The OR() formula is inserted as shown below.

OR function in Google Sheet - Example 3-2

3: Now, select cell B2, type the greater than symbol “>” and type 50000, as shown below.

OR function in Google Sheet - Example 3-3

4: Press “Enter”. We will get the output as “False” because 34,900 is not greater than 50000, as shown below.

OR function in Google Sheet - Example 3-4

5: Finally, drag the formula from cell C2 to C13 using the fill handle, as shown below.

OR function in Google Sheet - Example 3-5

Important Things To Note

  • We can test maximum arguments (criteria) simultaneously in the OR function.
  • The function ignores arguments with text values or blank cells.
  • When using the OR function in Google Sheets, we will get the #VALUE! error when any provided arguments do not interpret as a logical value.
  • While the numbers in an OR() argument do not require a double quotation, a text string must be within a double quotation.

Frequently Asked Questions (FAQs)

1) What is an alternate way to insert the OR function?

Sometimes we cannot remember in which category the “OR” function falls. Then, we can insert the function as follows:

Choose an empty cell 🡪 select the “Insert” tab 🡪 click the “Function” option right arrow 🡪 click the “All” option right arrow 🡪 select the “OR” function, as shown below.

OR function in Google Sheet - FAQ 1
However, as always, entering the function manually is the best way to avoid confusion.

Alternatively, we can also find the function icon to insert the OR function by following the path shown below.

● Choose an empty cell 🡪 click the “More” option represented by the three vertical dots at the end of the toolbar, as shown below.

OR function in Google Sheet - FAQ 1-1
● A list of icons appears when we click the “More” option. Here, click the “Functions” icon, as shown below.
OR function in Google Sheet - FAQ 1-2
● When we click the “Functions” icon we get the details shown in the below image.
OR function in Google Sheet - FAQ 1-3
From here, we know the rest to select the required function.

2) How does the OR function work in Google Sheets?2) How does the OR function work in Google Sheets?

The OR function compares multiple logical conditions and returns the function output as either TRUE or FALSE. If any provided condition is assessed as TRUE, the function returns TRUE. But if all arguments are FALSE, the function returns FALSE.

3) When to use the OR function in Google Sheets?

We can use the OR function in Google Sheets when we must make a logical TRUE or FALSE decision based on checking multiple conditions, simultaneously.

For example, consider the table with the awards won from sports, both indoor and outdoor games for the academic year 2023-2024. We will check which game has won more than 9 awards.
OR function in Google Sheet - FAQ 2
The steps to use the Google Sheets OR formula are,
Step 1: Choose cell D2 and enter the OR() formula =or($C$2:$C$9>9), as shown below.
OR function in Google Sheet - FAQ 2-1
Step 2: Press “Enter”. We get the output as “True” as 10 is greater than 9, thereby, satisfying the condition, as shown below.
OR function in Google Sheet - FAQ 2-2
Step 3: Drag the formula from cell D2 to D9 using the fill handle to get the output shown below.
OR function in Google Sheet - FAQ 2-3
Thus, the OR() function has returned the logical values as ‘TRUE’ and ‘FALSE,’ where the former indicates the games that won more than 9 awards and the latter refers to those having won less than 9 awards.

We can also use it with other Google Sheets functions and features involving logical tests, such as IF, AND, and conditional formatting.

Download Template

This article must help understand OR function in Google Sheets with its formulas and examples. You can download the template here to use it instantly.

Guide to What is OR Function In Google Sheets. We learn how to use it to compare multiple criteria along with its formula and examples. You can learn more from the following articles. –

Box Plot In Google Sheets

Google Sheets Combo Chart

Alternatives to VLOOKUP in Google Sheets

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *