Description of formula:

Allows to return different values depending on whether the given condition is fulfilled.

Formula can contain more than one condition. After every condition you must specify a value to return if this condition is met. If the first expression is true, the formula returns a following value, if it’s false – the second expression is evaluated, etc. When all conditions are not fulfilled, a value from the last parameter is returned.

The condition is an logical expression that returns

If formula can return any type of value, but values corresponding to all conditions in a single formula must have the same type.

Allows to return different values depending on whether the given condition is fulfilled.

Formula can contain more than one condition. After every condition you must specify a value to return if this condition is met. If the first expression is true, the formula returns a following value, if it’s false – the second expression is evaluated, etc. When all conditions are not fulfilled, a value from the last parameter is returned.

The condition is an logical expression that returns

*true*or*false*. You can do calculations, use any formula or comparison operators in it. To join multiple conditions, use or (||) and and (&&) keywords.If formula can return any type of value, but values corresponding to all conditions in a single formula must have the same type.

Syntax:

if(condition, value_true, …, value_false)

if(condition, value_true, …, value_false)

Parameters:

condition

(type: Logical) (multiple parameter) The expression that decide which value should be returned

value_true

(type: any) (multiple parameter) Value to return, if the preceding condition is fulfilled

value_false

(type: any) Value to return, if none of the conditions is met

Returned type:

any

Examples:

=if(A1=A2, 'yes', 'no')

=if(A1 < 100, 'small', A1 < 1000, 'medium', 'large')

=if(B2, 123, -123)

=if(section1.A1 > 0, 25, 20)

=if(A1=A2, 'yes', 'no')

=if(A1 < 100, 'small', A1 < 1000, 'medium', 'large')

=if(B2, 123, -123)

=if(section1.A1 > 0, 25, 20)

## 0 Comments