Logical Functions

Logical functions are listed by their name, description, and syntax.

AND

Returns 1 (TRUE) if all its arguments are non-zero; returns 0 (FALSE) if one or more arguments are 0 (FALSE).

AND(logicalexpression1, logicalexpression2,...)

Example model equation:

V All These Statements Are True = AND(1, 5 > 4, 5 = 2)

Example result: 0

FALSE

Logical "False". Returns 0.

FALSE

Example model equation:

V Value of False = FALSE

Example result: 0

IF

Returns second argument if logical expression evaluates to a non-zero value (TRUE) and third argument if it evaluates to 0 (FALSE).

IF (logicalexpression, returniftrue, returniffalse)

Example model equation:

V Sell Stock = IF(58 > 20, 1, 0)

Example result: 1

NOT

Inverts a logical expression. Returns 0 (FALSE) if argument is non-zero, and 1 (TRUE) if argument is 0 (FALSE).

NOT(logicalexpression)

Example model equation:

V Opposite of False = NOT(FALSE)

Example result: 1

OR

Returns 0 (FALSE) if all its arguments are 0 (FALSE); returns 1 (TRUE) if one or more arguments are non-zero.

OR(logicalexpression1, logicalexpression2,...)

Example model equation:

V One is True = OR(0, 3 > 2, 10 = 10)

Example result: 1

TRUE

Logical "True". Returns 1.

TRUE

Example model equation:

V Value of True = TRUE

Example result: 1

Commenting is not available in this weblog entry.