AND function

AND() function

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

Return TRUE or FALSE statements based on testing multiple logical conditions

=AND(logical1, [logical2], ...)


Return TRUE or FALSE statements based on testing multiple logical conditions.

Return TRUE if all arguments are TRUE, FALSE if just one of the arguments is FALSE.

AND syntax requires at least 1 argument, a logical condition. Up to 255 logical conditions can be tested with this function.


AND with text.

In the examples below, the AND function is used to test multiple text strings.

Use the AND function to return TRUE or FALSE statements based on testing text strings against multiple logical conditions.

Use the AND function to return TRUE or FALSE statements based on testing text strings against multiple logical conditions.

AND with numbers.

In the examples below, the AND function is used to test multiple numbers or cell references with numbers. Statements are also returned based on the result of an AND function combined with an IF function.

Use the AND function to return TRUE or FALSE statements based on testing numbers against multiple logical conditions.

Use the AND function to return TRUE or FALSE statements based on testing numbers against multiple logical conditions.

AND with dates.

In the examples below, the AND function is used to test multiple dates (essentially formatted serial numbers) and text strings.

Use the AND function to return TRUE or FALSE statements based on testing dates against multiple logical conditions.

Use the AND function to return TRUE or FALSE statements based on testing dates against multiple logical conditions.

Syntax

AND(logical1, [logical2], ...)

The AND function consists of at least 1 argument:

  1. logical1. Required. The first condition or logical value to evaluate.
  2. logical2. Optional. The second condition or logical value to evaluate.

Try it now!

  • Enter your formulas into the grey cells.

Scope

AND can be inserted into calculations to test multiple conditions.

  • Text:
 =AND(C2="Red",C3="Blue") || result is TRUE if cell C2 contains the text string "Red" and C3 "Blue"
  • Numbers:
 =AND(1=1,2=2) || result is TRUE as 1=1, 2=2
  • Dates:
 =AND(2/1/2022>1/1/2022,"3-Jan-2022">"2-Jan-2022") || result is TRUE for both serial number and text string dates
  • Boolean:
 =AND(TRUE,TRUE) || result is TRUE
  • Boolean:
 =AND(TRUE,FALSE) || result is FALSE
  • Combine with IF and OR:
 =IF(AND(OR(A1="Merry",A1="White"),B1="Christmas"),A1&" "&B1,"") || result is "Merry Christmas" or "White Christmas" if the conditions are met or an empty cell if the conditions are not met.

Caveats

  • Up to 255 logical conditions can be included in the AND function.
  • Each logical condition (logical1, logical2, etc.) or references must return TRUE or FALSE.
  • The AND function is not case-sensitive.
  • The AND function does not support wildcards.
  • The AND function will return #VALUE if no logical values are found.

Related Functions

  • OR() returns TRUE or FALSE statements if either logical condition is met.
  • NOT() reverses the logic of an argument.

Functions Category

 


Register (for free!) or Login to access bonus materials

About xlsnippets

Learn how to master functions, charts, pivot tables and more using Excel for Microsoft Office 365. Simple instructions and embedded spreadsheets help you practise the basics.

Latest Updates

26 March 2022
26 March 2022
26 March 2022
25 March 2022
22 March 2022

Coming soon

xlsnippets.com is currently in beta version. More functions and bonus content for registered users will be added weekly. Detailed training courses with additional downloadable resources are also on the horizon!