Syntax. AND(logical1,logical2, ...)
Definition. This function returns the logical value TRUE
only if all arguments are true. If the value of at least one argument is FALSE, the function returns FALSE
.
Arguments
logical1,logical2,... Up to 30 values (in Excel 2003) or up to 255 (in Excel 2007 or 2010), entered directly or resulting from conditions that can be evaluated to TRUE or FALSE
The arguments should be logical values (TRUE or FALSE), numbers, or values from arrays or references containing logical values or evaluated to logical values.
If an argument specified as an array or reference contains text or empty cells, these values are ignored if at least one of the arguments can be evaluated.
At least one of the arguments must be a logical value, a logical value resulting from a reference, or a logical value generated during the evaluation of logical expressions. Otherwise, the AND() function returns the #VALUE!
error.
If arguments contain error values, the result is also an error.
Example. If you enter the word text in cells H22 and H23, AND(H22,H23)
returns the #VALUE!
error, but AND(H22,H23,FALSE)
and AND(H22,H23,0)
each return FALSE
. If you replace FALSE with TRUE and 0 or another number, the logical value TRUE
is returned.
You get the same results if you enter the word text in cells H25 and H27 and enter a logical value or a number in cell H26. When AND(H25:H27)
is being evaluated, the cells containing text are ignored until one of the cells returns a logical value or a number.
The second example for the OR() function shows the connection between AND(), OR(), and NOT().