Test multiple conditions at the same time
=AND(logical1, [logical2], ...)
| Parameter | Description |
|---|---|
logical1 |
The first condition or logical value to evaluate. |
logical2 |
[optional] The second condition or logical value to evaluate. |
The purpose of the AND function is to evaluate multiple conditions and only return TRUE if all conditions are TRUE. Excel's AND function can handle up
=AND(TRUE,TRUE,TRUE) // returns TRUE
If any argument is FALSE, AND will immediately return FALSE:
=AND(TRUE,TRUE,FALSE) // returns FALSE
Typically, logical arguments are provided to AND as logical expressions, for example:
=AND(A1>0,A1<5)
=AND(A1>0,B1>0)
=AND(A1="red",B1="small")
All expressions in the formulas above will be evaluated as TRUE or FALSE. Notice that text values used in comparisons must be enclosed in double quote
=AND(1,2,3) // returns TRUE
=AND(1,2,0) // returns FALSE
You can use AND to check if a number in a cell is between two numbers. For example, to test if a number is between 10 and 20 we can use AND as seen in
=AND(B5>10,B5<20)
To include the numbers 10 and 20 in the allowed range of values, we can adjust the logic to use greater than or equal to (>=) or less than or equal to
=AND(B5>=10,B5<=20)