We often use logical judgment in EXCEL, but we seldom use logical operators, probably because we are not so happy with multi-condition judgment. As tables become more AND more complex, some EXCEL-related knowledge is greatly supplemented, including the logical operators 'and', 'or', '+', AND '*' in EXCEL ','*'.
Logical operators
Logical operators are generally divided into (AND) AND (OR) OR two types in other languages,
It is no exception in EXCEL, but there are two more abbreviations (I personally think), and this shorthand syntax format is not the same.
AND logic AND
Logic and,
TRUE is returned when the logical values of all parameters are TRUE. If the logical values of a parameter are FALSE, FALSE is returned.
OR logic OR
Logic or
In the parameter group, if the logical value of any parameter is TRUE, TRUE is returned. If the logical value of any parameter is FALSE, FALSE is returned.
+ (Better) logic and
AND can be replaced *.
* (Multiplication) logic or
OR can be replaced by +.
Usage
And or usage
If you already know the concepts of TRUE and FALSE
You can see the following equations:
The code is as follows: |
Copy code |
AND (TRUE, FALSE) = AND (1, 1, 1, 1, 0) = 0 OR (FALSE, TRUE) = OR) = 1
|
+ And * usage
Or the equation above. Pay attention to the added details.
The code is as follows: |
Copy code |
AND (TRUE, FALSE) = AND (1, 1, 1, 1, 0) = 1*1*1*1*1*0 = 0 OR (FALSE, TRUE) = OR) = 0 + 0 + 0 + 0 + 0 + 1 = 1 |
Example
Chinese |
Mathematics |
(*) Solution |
(+) Solution |
91 |
100 |
Excellent |
Full Score |
45 |
89 |
|
|
90 |
99 |
Excellent |
|
100 |
89 |
|
Full Score |
89 |
91 |
|
|
100 |
100 |
Excellent |
Full Score |
1. What are the "excellent" values displayed when the scores of the two subjects are greater than or equal to 90 "? (*) Solution
The code is as follows: |
Copy code |
= IF (A $15: A $20> = 90) * (B $15: B $20> = 90), "excellent ","") |
2. If the score of one or more subjects is used, the full score is displayed "? (+) Solution
The code is as follows: |
Copy code |
= IF (A $15: A $20 = 100) + (B $15: B $20 = 100), "full score ","")
|
Summary
Because we seldom use this logical operator in EXCEL,
Therefore, when we make multi-condition judgments, we often need to use some transitional cells for the transition,
However, with the help of these logical operators, when performing multi-condition judgment, we can simplify many steps.