Logical Functions

AND

Returns True only if both a and b are true. Otherwise returns False.

SyntaxWhereResult
AND(a, b)a is logical
b is logical
A logical value, true or false

 

ExampleResult
=AND(4 > 3, 5 < 7)True
=AND(4 > 3, 5 < 4)False

 


OR

Returns True is either a or b (or both) is true. Otherwise returns False.

SyntaxWhereResult
OR(a, b)a is logical
b is logical
A logical value, true or false.

 

ExampleResult
=OR(4 > 3, 5 < 7)True
=OR(4 > 3, 5 < 4)True
=OR(3 > 4, 5 < 4)False

 


NOT

Returns True if a is false, or False if a is true.

SyntaxWhereResult
NOT(a)a is logicalA logical value, true or false

 

ExampleResult
=NOT(4 > 3)True
=NOT(NOT(1 = 1)True

 


TRUE

Returns a logical true.

SyntaxResult
TRUE()A logical value, always true

 

ExampleResult
=TRUE()True

 


FALSE

Returns a logical false.

SyntaxResult
FALSE()A logical value, always false

 

ExampleResult
=FALSE()False

 


IF

Returns the value v if c is true, or w if c is false. Both v and w must be the same data type - e.g. both numbers or both text.

SyntaxWhereResult
IF(c, v, w)c is logical
v is anything
w is anything
Either or w

 

ExampleResult
="Hello" & IF(Gender = "Male", "sir", "madam")Gender = Male
"Hello sir"
Gender = NOT Male
"Hello madam"