How to use the OR function
The OR function allows you to carry out a logical test in each argument and if at least one argument returns TRUE the OR function returns TRUE.
If all arguments return FALSE the OR function also returns FALSE.
Formula in cell D3:
The picture above shows the formula in column D, it returns TRUE in cell D3, D4 and D5 because the amount is below 10.
Excel function syntax
OR(logical1, [logical2])
Arguments
logical1 | Required. A logical expression that returns a logical value or a number. |
[logical2] | Optional. You can have up to 254 additional arguments. |
Comments
The OR function arguments can result in TRUE or FALSE, however, it also treats all numbers, both positive and negative, as TRUE.
The exception to that is 0 (zero) which is treated the same as FALSE.
OR function - multiple conditions
The array formula in cell C3 performs two logical tests, if the value in cell B3 is equal to cell B11 or B12 and returns FALSE. Both values are not equal to the value in cell B3.
The technique used in column C that compares a value to multiple values using a cell range instead of declaring each logical expression in an argument each saves you time and effort. The downside is that you need to enter the formula as an array formula.
To enter the formula above as an array formula, type the formula in a cell. Press and hold CTRL + SHIFT keys simultaneously, then press Enter once. Release all keys.
The formula is now enclosed with curly brackets, they indicate you successfully entered the formula as an array formula. Don't enter the curly brackets yourself.
Download excel *.xlsx file
Articles with the 'OR' Function
The following 5 articles have formulas that contain the OR function.
Here is how to highlight every other row using conditional formatting. Conditional formatting formula: =ISEVEN(ROW())*OR($B3:$D3<>"") Alternative CF formula: =EVEN(ROW())=ROW() This […]
Question: I have a list that I keep adding rows to. How do i create a border that expands as […]
If cell equals value from list
Regular formula Formula in cell C3: =IF(COUNTIF($E$3:$E$5,B3),"Yes","No") The COUNTIF function counts how many values in E3:E5 match cell B3, it returns […]
How to filter using OR logic between columns [Formula]
The filter feature in Excel won't allow you to do OR logic between columns, however, you can if you allow […]
The formula above in cell D3 performs two different logical tests, if at least one of them is TRUE one […]
Functions in 'Logical'
The OR function function is one of many functions in the 'Logical' category.
The image above demonstrates the AND function with two logical expressions. If the value in column B is equal to […]
The FALSE function returns the logical (boolean) value FALSE. Excel Function Syntax FALSE() Arguments The FALSE function has no arguments. […]
Checks if a logical expression is met. Returns a specific value if TRUE and another specific value if FALSE.
How to use the IFERROR function
The IFERROR function lets you catch most errors in Excel formulas. It was introduced in Excel 2007. In previous Excel […]
The IFNA function handles #N/A errors only, it returns a specific value if the formula returns a #N/A error. Formula […]
The IFS function checks whether one or more conditions are met and returns a value that corresponds to the first […]
The NOT function returns the boolean opposite to the given argument. TRUE returns FALSE and FALSE returns TRUE. Formula in […]
The OR function allows you to carry out a logical test in each argument and if at least one argument returns […]
How to use the SWITCH function
The SWITCH function returns a given value determined by an expression and a list of values. If the expression matches […]
Returns the logical (boolean) value TRUE. Excel Function Syntax TRUE() Arguments The TRUE function has no arguments. Comments Excel interprets […]
The XOR function was introduced in Excel 2013 and calculates the logical exclusive OR meaning if at least one of the […]
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form