Excel: OR function - how it works
The OR function in Excel checks any number of conditions and returns either "TRUE" or "FALSE". This makes it easy to integrate into other functions such as the IF function and can simplify it. We show you how to use the OR function correctly.
Structure of the OR function in Excel
- The formula is "= OR (Condition1; Condition2; ...)".
- You can include any number of conditions in the OR function.
- If none of the conditions are met, the program outputs "FALSE".
- As a condition, you can, for example, specify inequalities like "A1 <4" or refer directly to cell contents (A1 = "Name").
OR function: example
In our example it is a matter of checking whether a number of numbers exceeds a limit value.
- Column A contains four values between 1 and 10 (A2 to A5).
- In column B there is a limit for each value in column A, which the values in column A should not exceed.
- The OR function is in cell D3: "= OR (A2> B2; A3> B3; A4> B4; A5> B5;)"
- As long as none of the values exceed the limit, the function returns "FALSE".
- If a value exceeds the limit, "TRUE" is output.
Install the OR function in another function
Usually, a cell should not only contain true or false, but a value or a word of your choice. You can do that with the IF function.
- The IF function is: "= IF (condition; then; otherwise)".
- Enter the OR function as a condition.
- "Then" is the value that you want to output if the condition is true.
- With "Otherwise" enter what should be output if the condition is incorrect.
- In our example we enter "= IF (OR (A2> B2; A3> B3; A4> B4; A5> B5;);" Not OK ";" OK ")".
- Excel now returns "OK" if none of the values exceed the limit. In this case, the OR function returns "FALSE".
- If one of the values exceeds the limit value, "Not OK" is returned.