Skip to main content

Built-in Functions: Logical

  • 4 minutes to read

The ExpressSpreadSheet function repository automatically registers all function signatures in the table below. Each signature has a corresponding function in Microsoft Excel® under the “Logical“ category. These functions include logical operators, conditional tests, and functions that return constant Boolean values.

All listed function signatures are implemented and ready for use in formula expressions. You can override any function’s implementation as the “How to Create Custom Functions“ topic describes.

No.

Function

Implemented

XLS Token

Parameters

Syntax

Description

1.

AND

Yes

36

The Logical1 and Logical2 mandatory parameters that accept logical (Boolean) values or logical expressions that return logical results.

=AND(Logical1, Logical2)

Performs the logical AND operation.

This function returns TRUE only if TRUE is passed as the both parameters; otherwise – returns FALSE. The AND function is often used in conjunction with other functions that return and/or accept logical (Boolean) values.

To localize the AND function’s name and short description, use the sfnAnd and sfnAndDescription resource strings.

2.

FALSE

Yes

35

The function accepts no parameters.

=FALSE()

Returns the logical value FALSE.

You can use this function if you need the logical value FALSE in your formula expression. Alternatively, you can just type ‘FALSE’.

To localize the FALSE function’s name and short description, use the sfnFalse and sfnFalseDescription resource strings.

3.

IF

Yes

1

Three mandatory parameters:

  • Logical. A logical (Boolean) value or expression that indicates the value that the IF function returns.

  • Value1. The function returns this value if Logical is TRUE.

  • Value2. The function returns this value if Logical is FALSE.

=IF(Logical, Value1, Value2)

Performs a logical test and returns either of the specified values depending on the test’s result.

The IF function returns the second or third parameter if the logical test succeeds (TRUE) or fails (FALSE), respectively.

To localize the IF function’s name and short description, use the sfnIF and sfnIFDescription resource strings.

4.

IFERROR

Yes

255

Two mandatory parameters:

  • Value. A formula expression whose error the IFERROR function intercepts.

  • ValueIfError. A value that the function returns instead of an error code.

=IFERROR(Value, ValueIfError)

Checks the specified formula expression for errors and returns the special value instead of an error code if an error occurs.

You can use this function to handle possible errors in your formula expressions. The IFERROR handles the #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, and #NULL! error codes that the specified expression can return.

Use the IFNA function if you need to handle only the #N/A error code.

To localize the IFERROR function’s name and short description, use the sfnIfError and sfnIfErrorDescription resource strings.

5.

IFNA

Yes

255

Two mandatory parameters:

  • Value. An evaluated formula expression.

  • ValueIfNA. The value that the IFNA function returns instead of the #N/A error code.

=IFNA(Value, VauleIfNA)

Checks if the specified formula expression returns the #N/A error code and returns the special value instead.

This function works similarly to IFERROR, but checks the specified expression only for the #N/A error code.

To localize the IFNA function’s name and short description, use the sfnIfNA and sfnIfNADescription resource strings.

6.

NOT

Yes

38

Logical is the only mandatory parameter that accepts a logical (Boolean) value that the NOT function inverts.

=NOT(Logical)

Performs the logical negation operation.

Use this function to invert a logical (Boolean) value.

To localize the NOT function’s name and short description, use the sfnNot and sfnNotDescription resource strings.

7.

OR

Yes

37

The Logical1 and Logical2 mandatory parameters that accept logical (Boolean) values or logical expressions that return logical results.

=OR(Logical1, Logical2)

Performs the logical OR operation.

This function returns TRUE if either of the parameter values is TRUE; otherwise – returns FALSE. Like AND, the OR function is often used together with the functions that return and/or accept logical (Boolean) values.

To localize the OR function’s name and short description, use the sfnOr and sfnOrDescription resource strings.

8.

TRUE

Yes

34

The function accepts no parameters.

=CRITBINOM(Trials, ProbabilityS, Alpha)

Returns the logical value TRUE.

You can use this function if you need the logical value TRUE in your formula expression. Alternatively, you can just type ‘TRUE.

To localize the TRUE function’s name and short description, use the sfnTrue and sfnTrueDescription strings.

9.

XOR

Yes

255

Logical1 is the only mandatory parameter that accepts an evaluated logical (Boolean) value or expression.

Optionally, you can pass up to 254 additional logical values or expression.

=XOR(Logical1, [Logical2], [Logical3], …)

Returns the logical exclusive OR of all specified values.

You can use the XOR function in an array formula.

The function returns the #VALUE! error code if all parameter values are not logical (Boolean).

To localize the XOR function’s name and short description, use the sfnXor and sfnXorDescription resource strings.