Related Function:

The AND function tests a number of supplied conditions. Returns TRUE if all its arguments evaluate to TRUE; returns FALSE if one or more arguments evaluate to FALSE.

Syntax

=AND(logical_test-1,[logical_test-2], … )

Note: If the logical_tests evaluate to numbers, instead of logical values, the value zero evaluates to FALSE and all non-zero values are treated as the logical value TRUE.

Arguments

Argument Description
logical_test-1 The first condition that you want to test that can evaluate to either TRUE or FALSE
[logical_test-2] … Optional. Additional conditions that you want to test that can evaluate to either TRUE or FALSE

Note: Beginning with Excel 2007, you can enter up to 255 logical_test arguments to the Excel AND function. However, in Excel 2003, the function can only handle up to 30 arguments.

Examples

  A B C D
1 Data      
2 50      
3 150      
4        
5 Formula Result Notes
6 =AND(TRUE,TRUE) TRUE All arguments are TRUE
7 =AND(TRUE,FALSE) FALSE One argument is FALSE
8 =AND(2+2=4,3+3=6) TURE All arguments are TRUE
7 =AND(1<A2,A2<100) TRUE Displays TRUE if the number in cell A2 is between 1 and 100. Otherwise, it displays FALSE
8 =IF(AND(1<A3,A3<100),A3,”Value out of range”) Value out of range Displays the number in cell A3, if it is between 1 and 150. Otherwise, it displays the message “Value out of range.”
9 =IF(AND(1<A2,A2<100),A2,”Value out of range”) 50 Displays the number in cell A2, if it is between 1 and 100. Otherwise, it displays a message

Usage note: One common use for the AND function is to expand the usefulness of other functions that perform logical tests. For example, the IF function performs a logical test and then returns one value if the test evaluates to TRUE and another value if the test evaluates to FALSE. By using the AND function as the logical_test argument of the IF function, you can test many different conditions instead of just one.

Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if the specified range contains no logical values