Today we are sharing the OR function and its 4 common usages. Let's take a look at the details
a) Role. is a logical function that checks whether any condition is true. In its parameter group, any parameter with a logical value of true returns true; False is returned only when the logical value of all parameters is false. That is, to determine whether at least one of the multiple conditions is true.
b) Grammar. or(logical1,logical2,..
Translated into Chinese is: or (logical value 1, [logical value 2],
Parameter: logical1 required. The first condition to be detected, which evaluates to true or false
logical2], optional. Other conditions to be detected, which evaluate to true or false
c) Description. It can contain up to 255 conditions (the number of conditions contained varies depending on the Excel version, for example, Excel 2003 can contain up to 30 conditions; Excel 2007 and later versions can contain up to 255 conditions).
The parameter must evaluate to a logical value, such as true or false, or the parameter must be an array or reference containing a logical value.
If the array or reference argument contains text or blank cells, these values are ignored;
If the result of the calculation of the provided condition is not a logical value but a numeric value, the zero value is considered false, and the remaining non-zero values are considered true to participate in the calculation.
If the OR function does not get a logical value (true or false) during the calculation, an error prompt value!! will be returned.
1.Look for students with a score greater than 80 in a Chinese or Mathematics subject.
Formula: =or(C2>80,D2>80) (double click the fill handle to fill the formula down).
Note: First, determine whether the language score is greater than 80, and return true if it is greater than that; Then judge whether the math score is greater than 80, not greater than returning false, get the result =or(true, false), and finally check whether at least one of all conditions is true, and at least one of them is true if it returns true.
2.An example is given when the OR function returns uppercase and lowercase letters in a parameter.
Formula: =or(a14=b14,1=2).
Note: The OR function is not case-sensitive, for example, y returns true compared to y. Judge "y" = first"y", the result is true, then judge 1=2, the result is false, get the result =or(true, false), and the final result is true.
3.An example is an example of the OR function that returns a result when a reference parameter contains text or a blank cell.
Formula: =or(a21,"y"="y")
Note: If the parameter is only a cell reference, the blank cell or text is ignored and does not participate in the logical judgment. That is, the references to cells A21 and A22 are ignored and only judged"y"="y"。
4.If the parameter contains the number 0 (not a cell reference), false is returned
Formula: =or(a26) or =or(0).
Note: 0 is treated as the logical value false, so false is returned.
The OR function is often used in combination with other functions, and the usage will be described later, so stay tuned.
The above is an example of the and function and its usage, have you mastered it? If you have seen it a thousand times, it is better to pass it with your hands once; What you learn is what you earn, so let's try it out
Send a private message to "Exercise" to get the exercise file of this article.
Check it outBest practices for excel chartsColumn Learning**Data Visualization Practical Dry Goods Article: