Excel OR Function
In this Article
This Excel Tutorial demonstrates how to use the Excel OR Function in Excel to test if one or more criteria is true, with formula examples.
OR Function Description:
The OR Function Checks whether any conditions are met. Returns TRUE or FALSE.
|No Conditions Met||=OR(C5 > 5,D5 > 5)||False|
|One Condition Met||=OR(C6 > 5,D6 > 5)||True|
|Two Conditions Met||=OR(C7 > 5,D7 > 5)||True|
|Text – Conditions Met||=OR(C8 =”apples”,D8 > 5)||True|
|Text <> Equal||=OR(C9 <>“pears”,D9 < 5)||True|
Syntax and Arguments:
The Syntax for the OR Formula is:
Function Arguments ( Inputs ):
logical1 – Logical expressions. Example: A1 > 4.
Use the OR Function to test if one or more conditions are met. Each condition must be a logical expression (ex: a1 >5), a reference to a cell containing TRUE or FALSE, or an array containing all logical values. If one or more conditions are TRUE, the formula returns TRUE, otherwise it returns FALSE.
OR is a logical function and is generally used in conjunction with another logical function, IF:
The IF Formula does one thing if a condition is TRUE and does another if a condition is FALSE. Often when using the OR Function you will “nest” it within an IF Function.
You may also want to use these other logical functions:
AND Formulas test if all conditions are met.
XOR Formulas test if one and only one condition are met.
OR Examples in VBA
You can also use the OR function in VBA. Type:
For the function arguments, you can either enter them directly into the function, or define variables to use instead.
Return to the List of all Functions in Excel
How to use the OR Function in Excel:
To use the AND Excel Worksheet Function, type the following into a cell:
After entering it in the cell, notice how the AND formula inputs appear below the cell:
You will need to enter these inputs into the function. The function inputs are covered in more detail in the next section. However, if you ever need more help with the function, after typing “=OR(” into a cell, without leaving the cell, use the shortcut CTRL + A (A for Arguments) to open the “Insert Function Dialog Box” for detailed instructions:
For more information about the OR Formula visit the