Hi, today we are going to learn how to use OR function in Google Sheets. The Google Sheets Or function is a logical function that verifies the data and returns a value of True or False. The OR function of Google Sheets will be covered in this article along with its usage. So let’s get going.
Advantages of the OR Function in Google Sheets
To verify the values in the data, we use the OR function. You can utilize the TRUE and FALSE replies provided by this logical function to arrange your data. To find the value in return in various cases, you can combine the AND and OR functions. Instead of receiving True or False, the required string is returned when the OR function and the IF function are combined. In the part that follows, I’ll walk you through a step-by-step tutorial on how to use the OR function in Google Sheets practically with the help of examples.
You may also like>>> How to Print Addresses on Envelopes from Google Sheets [Quick Guide]
How to use OR Function in Google Sheets
In this tutorial on Google Sheets’ OR function, we’ll go through two practical examples of how to apply it in different situations.
Example# 1:
Step 1>
If we look at the example below, we can see sample sales data for a few days for several products. By using Google Sheets’ OR function in this case, we will discover that any sale is larger than 50 products in a single day.
Step 2>
Place the mouse where you wish to use Google Sheets’ OR function, and then start the function by writing “OR” in the cell followed by an equal sign as seen below.
Step 3>
The first logical expression will be specified in accordance with the syntax of the OR function, as I have done above by writing “C3>50” as the function’s first expression.
Step 4>
Similar to the first, we will now define the second logical expression. Since we are seeking sales larger than 50, we have put “D3>50” in this case as well.
Step 5>
Since there are just two criteria in this sample data set, we will close the function and hit Enter to obtain the result shown in the following image.
Step 6>
Once you have the first result in the cell, all further results can be obtained by simply dragging the formula over the other cells in the manner described below.
Using Google Sheets’ OR function, you can use this method to determine whether the value is true or false.
Example# 2:
Step 1>
The string for weekdays is in the column in the example data that follows, as may be seen below. Using Google Sheets’ OR function, we must determine whether a weekend is present.
Step 2>
Similar to the previous way, we will use this one to start the function as I have in the example below by writing the first part of the syntax, which is the function name.
Step 3>
We will specify the first condition we are looking for after the function has started. To find the word “Saturday” in the list, I have typed “D28=” Saturday” here.
Step 4>
Since Sunday is the second weekend day, we have written “C19=”Sunday” as the second condition to search for Sunday in the data, as seen below.
Step 5>
You’ve finished the syntax and hit Enter to receive the result. To discover weekends in the data, drag this formula over the other cells along the weekdays.
Step 6>
The cells that equal “Saturday” and “Sunday” are marked with “True” as seen in the result, which is highlighted below. You can determine whether there are weekends in the data in this way.
Additional Example:
How to use the OR function with the AND function of Google Sheets?
Google Sheets’ OR function only accepts two logical expressions from the data range. However, you must combine the OR function with the AND function to provide multiple criteria if you need to add extra conditions to the grammar to determine whether a statement is true or false. The steps are listed below so you can comprehend them practically with ease.
Step 1>
With the use of a mixture of Google Sheets’ OR and AND functionalities, we will use the three possible scenarios in the following data to determine whether or not the student is eligible for the passing criterion.
Step 2>
As shown in the following example, we start by writing the “OR” function with an equal sign, then execute the “AND” function by including the small bracket in the syntax.
Step 3>
After starting both processes, we will first finish them by writing the values for Google Sheets’ “AND” function, where I will specify the first two criteria as shown in the screenshot below.
Step 4>
After writing the first two data scenarios, close the bracket to end the AND function, and then write the third data scenario as shown in the image below.
Final Formula(Syntax): =OR(AND(D23>=40,E23>=40),F23=”Yes”)
Step 5>
Once you have finished entering both expressions for both functions, simply press the Enter key to obtain the result. Drag the formula down over further cells to obtain additional results.
The results are shown in the below image, which shows that the ranges that meet the requirements are true while the others are false.
By combining the OR and AND functions in Google Sheets, you may use this method to determine whether the value is true or false under a number of different scenarios.
Often Asked Question (Example):
How to nest the IF function with the OR function in Google Sheets?
Google Sheets’ OR function only returns True or False as a result when we apply it, so if you want to retrieve any other values in addition to True and False, you may need to nest the IF function inside of the OR function.
Step 1>
Here is a table showing various cities’ populations from two separate years from the data below. With the use of Google Sheets’ nesting IF function and OR function, we will examine the population density status for these cities in this table and categorize it as high density or low density.
Step 2>
We will first construct the Google Sheets “IF” function, and then we will add the “OR” function using the syntax shown in the following screenshot.
Step 3>
Here, we will specify the criteria that we wish to search for in accordance with the OR function. I’m looking to see whether there is a value bigger than 50,000, so let’s write the formula as it is shown below.
Step 4>
After defining the criterion, our OR function is complete. Now that we’re ready to provide the result to be returned, we’ll use the IF function. Below, I’ve marked the values “High Density” and “Low Density” as true and false, respectively.
Final Formula(Syntax): =IF(OR(D51>=50000,E51>=50000),”High Density”,”Low Density”)
Step 5>
Simply press the Enter key after you have finished writing the syntax to obtain the result, then drag the formula to the other cells. The result will be as follows.
By doing so, you are able to label the value in addition to determining whether it is true or false.
You may also like>>> How to Import JSON in Google Sheets [Complete Direction]
Frequently Asked Question
In Google Sheets, can I use the OR function on text values?
Yes, text values can be used with the OR function. Even if the conditions contain text, it will return TRUE if at least one of them is true.
Can I use the OR function with a certain amount of conditions?
The OR function in Google Sheets accepts up to 30 inputs.
How can I perform more intricate logical tests using the OR function?
To develop more complex logical checks and calculations, stack the OR function inside of other functions like IF or SUM.
What separates the AND function from the OR function?
While the AND function only returns TRUE if all criteria are true, the OR function returns TRUE if at least one condition is true. The “any” operator is OR, the “all” operator is AND.
Is it possible to combine the OR operator with other logical operators, such as NOT?
Yes, you can reverse what is logical by using the NOT function in conjunction with the OR function. For example, the function =NOT(OR(A1=”Yes”, B1=”Yes”)) returns TRUE if neither A1 nor B1 is “Yes“.
Conclusion
In conclusion, Today we learned “how to use the OR function in Google Sheets” Google Sheets’ OR function is a useful tool for analyzing a variety of circumstances. It streamlines the process, whether you’re handling data or making decisions. Now you can put it in your spreadsheets with confidence to increase productivity. Cheers to spreadsheets! For keep learning with OfficeChaser.