AND Specify logical OR and logical AND for the judgment condition.(Microsoft Excel)
This function is used to specify logical OR and logical AND for IF function, IFS function, conditional format, etc.
How it works
AND(Logical1 to 255) OR(Logical1 to 255)
Argument | Omission | Specify |
---|---|---|
Logical1 to 255 | value1 is required. | Specify the match condition as a number or a string. Partial specification with wildcards is not possible. |
Example Results
Combine with IF Function and IFS function
Single condition
In AND function, "Qty is 40 or more and Category is 1",
OR function to set the condition "Qty is less than 25 or greater than 61".
The formulas are as follows
AND(Qty cell>=40, Category cell="1") OR(Qty cell<=25, Qty cell>=61)
This time, we use it for the IF function condition, and if the condition is matched, the text "Yes" is displayed.
Compound conditions
By nesting AND and OR functions, it is possible to set complex conditions by combining each condition.
(Qty is 40 or more and Category is 1) or (Name is F).
=IF(OR(AND(Qty cell>=40,Category cell=1),Name cell="F"), "Match","")
However, as the number of conditions increases, the formulas become difficult to read.
In this case, we recommend using only one AND or OR function per cell and dividing the formulas.
Conditional Formatting.
Select the range of cells you wish to set and choose "New Rule" under "Conditional Formatting".
Select "Use a formula to determine which cells to format" and set logical formulas that incorporate functions.
The final result of the formula should be True or False.
Spill
To "Spill" the AND and OR functions, use the BYROW or BYCOL functions.
=BYROW(A1:B4,LAMBDA(r,AND(r)))
=BYCOL(F1:I2,LAMBDA(r,OR(r)))
---
Discussion
New Comments
No comments yet. Be the first one!