OR Function in Excel
OR function in excel is used to test different conditions in the meantime. This logical function helps you in comparing two values or statements in excel. It will return TRUE, if at least any one of the arguments or conditions evaluates as TRUE. Similarly, it will also return FASLE, if all the arguments or conditions are FALSE.
The OR function accepts the following parameters and arguments:
- Logical1– Required. This is referred to as a condition for testing that can be either TRUE or FALSE.
- Logical2, …Logical_n – [Optional]. Conditions for testing can either be TRUE or FALSE. There can be a total of 255 conditions (in modern Excel versions).
- Return Value: The return value will be TRUE if any of the arguments are true, otherwise the return value will be FALSE.
When the OR formula is written is =OR(A1<10, A1=40)
You can see the excel spreadsheet below:
When the formula is written is =OR(A1=45, A2=“Google”)
Consider the Excel spreadsheet below:
When the OR formula written is =OR(A1>=5,A1=25,A2= “e2esols.com”)
Look at the spreadsheet below to understand the above example.
In Combination with the AND and IF function
The AND and OR functions are the well-known logical functions of spreadsheets, and what these two functions do is to test to see whether the result from at least two target cells meets conditions that you determine. These functions will only return one of the two results, which you can also call Boolean values: TRUE or FALSE.
- For the OR function – row 2 above – various conditions are tested and if any of the tested conditions is valid, at that point the OR function return value is TRUE. Just if all conditions are not genuine will OR give you a FALSE return value.
- For the AND Function – row 3 above – different conditions are tested and just if the majority of the conditions are genuine will the function give a return value TRUE. If not, the function returns FALSE as the return value.
The OR and AND function can be combined with other functions such as the IF function. In the above example, you can see the rows four and five have been combined with IF function, to get a variety of results.
Things to Remember
- The OR is a logical function which is used to test two or more conditions or arguments at the same time.
- The return value OR function is either TRUE or FALSE.
- The return value depends on the arguments which you input in the OR formula.
- There can be a total of 255 conditions or arguments to be tested at the same time through OR Excel function.
- OR function can be combined with other logical functions such as AND or IF.
This has been a guide to OR Function in Excel. Here we discuss the OR Formula in excel and how to use OR function along with excel example and downloadable excel templates. You may also look at these useful functions in excel –