An Excel OR function is a logical function which is most often used in conjunction with the Excel IF function and the Excel AND function. It is used to test multiple conditions at the same time. This tutorial will teach you how to create Excel OR formulas and give you examples of how to use the OR function.
OR Function Arguments
The syntax of the IF function is:
logical1 – This is a required argument and is the value or logical expression that can be either TRUE or FALSE. You can specify a value, date, number or any comparison operator
logical2, logical3 – This is an optional argument and is the value or logical expression that can be either TRUE or FALSE. You can specify a value, date, number or any comparison operator
Excel OR Formula Example
In this example I want to give a bonus if the area is North or the sales is over £10,000. The formula in cell D2 is =OR(B2="North",C2>10000). The first argument in the OR function tests if the area in cell B2 is “North”. The second argument tests if the sales in cell C2 is over £10,000. Note the comparison operator ">" for greater than. If any of these conditions are met then it returns TRUE. If none of these conditions are met then it returns FALSE.
Nesting Excel OR Function in an IF Function
Lets take this a stage further. Sometimes we don't want to give a result that says just TRUE or FALSE. We want to return something that is more meaningful. To do this we can nest an OR function inside an IF function.
Let's have a look at an example.
The formula in cell D2 is =IF(OR(B2="North",C2>10000),"Bonus","No Bonus"). The OR function is testing to see if cell B2 is “North” or cell C2 is over £10,000. The OR function is the IF functions logical_test argument. If one or both conditions are met then the IF functions value_if_true argument returns “Bonus” otherwise the value_if_false argument returns “No Bonus”.
To learn about the IF function and its arguments then please see my tutorial on How to Create an Excel IF Formula.
I hope you enjoyed this tutorial on how to create Excel OR Formulas. If you have any questions or feedback then please leave a comment and I will get back to you as soon as I can. I always like to receive your comments.