The AND function in Google Sheets is a powerful logical operator that computes whether all the specified conditions are true. When you need to ascertain that multiple criteria are satisfied at once, this function serves as an essential tool for decision-making processes in spreadsheet calculations.
Syntax
AND(logical1, [logical2, ...])
- logical1: The first condition you want to test; it must be a logical expression or a cell reference.
- logical2: Optional subsequent conditions to test; additional logical expressions or cell references that are evaluated.
Example #1
=AND(A1>10, B1<5)
This function checks if the value in cell A1 is greater than 10 and the value in cell B1 is less than 5. If both conditions are true, it returns TRUE; otherwise, it returns FALSE.
For instance, if A1 is 15 and B1 is 3, the result would be TRUE.
Example #2
=AND(A2="Yes", B2="Complete")
This function evaluates whether cell A2 contains 'Yes' and cell B2 contains 'Complete'. If both statements are correct, it outputs TRUE. For example, if A2 is 'Yes' and B2 is 'Complete', the output is TRUE.
Example #3
=AND(C1=100, D1="Active")
This checks if the value in cell C1 equals 100 and if D1 is 'Active'. If both conditions are satisfied, the function returns TRUE; if either is false, it returns FALSE. Assuming C1 is 100 and D1 is 'Active', the result is TRUE.
Error handling
- VALUE!: This error occurs if one of the arguments is non-numeric when a numeric comparison is expected.
- N/A: This error indicates that the function cannot evaluate one of the arguments.
- NAME?: This arises if the function's name is misspelled or if Excel is unable to recognize it.