Excel OR function used to determine a condition. If met ANY of the conditions returns TRUE. If not met ALL conditions return FALSE.
OR(logical1, [logical2], ...)
logical1, required, evaluate the first condition
logical2, optional, up to a maximum of 255 conditions
Excel ignore any argument contains text or empty cells. OR function returns the #VALUE! Error if any argument contains no logical values.
The following is an example of using an OR function with two conditions to be evaluated.
The result is as shown below
The OR function returns TRUE if there is a TRUE condition, either one or all.
The following is an example of using an OR function with three conditions to be evaluated.
The result is as shown below
From the picture above, OR function returns TRUE if there is only 1 logical value TRUE. Returns FALSE if all conditions are FALSE.
For example, there are data such as the image below
Which of the twelve names above have no ideal weight? The BMI value (body mass index) determine the criteria. You can calculate The BMI value by dividing the weight (in KG) by the height (in Meter2).
According to BMI, the ideal weight criteria is greater than or equal to 18.5 and smaller or equal to 24.9. The BMI value for not perfect weight is the opposite, i.e., less than 18.5 OR more than 24.9.
There are two conditions to be evaluated. Condition #1 BMI<18.5 and condition #2 BMI>24.9. If met ANY of the conditions then returns TRUE (Not ideal weight). So, use OR function to evaluate the conditions.
Here are the steps on how to use OR function.
If completely typed, the formula will look like below.
=OR(D2<18.5,D2>24.9)
Do a copy in cell E2 then paste in range E3:E13. The result is as shown below.
There are ten names have no ideal weight (under or over). All of them met one of two conditions.
The result of OR function is not informative, because it only displays TRUE/FALSE value. Want more informative result? Use Excel IF Statement.
Due to the unique characteristic of TRUE/FALSE logical value, you can use simple addition formula as OR function replacement. TRUE converted to number 1 and FALSE to number 0 if involved in mathematical operations.
The logical OR function will be TRUE if at least one condition is TRUE. The total value of addition formula at least 1, indicating there is a TRUE value.
Suppose there is data like the image below. Can you use the addition formula as OR function replacement?
The result is as shown below
The OR function and the addition formula have the same results.
If there are three conditions, can you use the addition formula instead of the OR function?
The result is as shown below
The addition formula and OR function results still the same.
Suppose there is data such as the picture below, the same study case with the previous. Can you use the addition formula instead of the OR function to find anyone who had not ideal weight?
According to BMI, not ideal weight is less than 18.5 OR more than 24.9.
There are two conditions; both do not have to be TRUE. The addition formula is used to add the condition #1 (checks whether BMI is less than 18.5) and condition #2 (checks whether BMI is more than 24.9).
Here are the steps to use the addition formula as OR function replacement.
If completely typed, the formula will look like below.
=(D2<18.5)+(D2>24.9)>=1
Do a copy in cell F2 then do a paste in range F3:F13. The result is as shown below.
The results are same as OR functions.
Calculate Number of Days Between Two Dates Excel has a function that calculates the number of days between two dates,…
What is Flash Fill Excel Flash Fill automatically fills your data when Excel detects a pattern in your initial data…
What is Paste Special Paste special is a paste but you can choose the result type. As we all know,…
What is the Excel TEXTJOIN Function? The excel TEXTJOIN function is the best function to concatenate strings in Excel, has…
What is the Excel CONCAT Function? The excel CONCAT function combines all data; it could be a text, a number…
What is the Excel CONCATENATE Function? The excel CONCATENATE function combines text or numbers into a text. CONCATENATE Syntax CONCATENATE(text1,…