Search

 

Module: Editor

Version: 2.2.1 +

Type: Long, Double, Date, Boolean or String

Category: Logical

 

Description

The formula 'If' checks whether a specified condition is met, and returns a specified value if True or another specified value if False. When you use values of rank 1 or 2, you have to use the ‘If’ formula in the category ‘Matrix’.

Parameters

Logical_test:              this is any value or expression that can be evaluated to True or False

Value_if_true:            this is the value that is returned if 'Logical_test' is True

Value_if_false:           this is the value that is returned if 'Logical_test' is False

Example

Description

In the following example the formula 'If' is used to get one of two specified values depending on the outcome of the 'Logical_test'.

Values parameters

Logical_test:              10 > 100

Value_if_true:            1

Value_if_false:           0

Result

Output:         0

The outcome is 0, because the logical test 10 > 100 is False.

Related Topics

- IfMatrix: The formula 'IfMatrix' checks whether a condition is met, and returns a specified matrix if True, and another specified matrix if False.

Feedback

If you have any questions about this subject or if you want to provide us feedback please send us an e-mail.

Updated: 2016-05-11