Vivek Verma
  • Home
  • Portfolio
  • Resume
  • Blog
  • Technical Reference
  • Contact Me

AND

AND

Returns TRUE if all its arguments are TRUE; returns FALSE if one or more arguments is FALSE.

Syntax

AND(logical1,logical2, ...)

Logical1, logical2, ...   are 1 to 30 conditions you want to test that can be either TRUE or FALSE.

  • The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays or references that contain logical values.
  • If an array or reference argument contains text or empty cells, those values are ignored.
  • If the specified range contains no logical values, AND returns the #VALUE! error value.

Examples

AND(TRUE, TRUE) equals TRUE

AND(TRUE, FALSE) equals FALSE

AND(2+2=4, 2+3=5) equals TRUE

If B1:B3 contains the values TRUE, FALSE, and TRUE, then:

AND(B1:B3) equals FALSE

If B4 contains a number between 1 and 100, then:

AND(1<B4, B4<100) equals TRUE

Suppose you want to display B4 if it contains a number strictly between 1 and 100, and you want to display a message if it is not. If B4 contains 104, then:

IF(AND(1<B4, B4<100), B4, "The value is out of range.") equals "The value is out of range."

If B4 contains 50, then:

IF(AND(1<B4, B4<100), B4, "The value is out of range.") equals 50

I Would Love to Have You Visit Soon!

  • Home
  • Portfolio
  • Resume
  • Blog
  • Technical Reference
  • Contact Me