Other Logical Functions

Excel > Excel 2007 Intermediate > More Advanced Functions

AND and OR Functions

And and OR are logical functions that can test up to 30 conditions. They are frequently combined with another function, such as IF, to create more powerful and intelligent formulae.

AND

The AND function only returns true if every condition is met. If any condition fails it returns false.

The syntax for the AND function is:

=AND(logical_1, logical_2, )

Cell C2

Cell D2

Function

Result

25

50

=AND(C2>20, D2>40)

True

40

60

=AND(C2>50, D2>50)

False

10/05/2009

100

=AND(C2>01/04/2009, D2>100)

False

20

80

=AND(C2<50, D2<100)

True

OR

The OR function returns true if at least one condition is met. OR will return false only if all of the conditions fail.

The syntax for the OR function is:

The syntax for the OR function is:

Cell C2

Cell D2

Function

Result

25

50

=OR(C2>20, D2>40)

True

40

60

=OR(C2>50, D2>50)

True

10/03/2009

100

=OR(C2>01/04/2009, D2>100)

False

20

110

=OR(C2>15, C2<50, D2<100)

True

Follow us on

Facebook  Twitter  You Tube