IF() function

Use logical conditions in a formula

🗒️ Description

The IF function allows users to input different values or formula based on logical expressions.


An IF statement can have two results. The first result is if your logical condition is True, the second if your comparison is False.

✏️ Syntax & variables

1 if(condition, value_if_true , value_if_false)

✅ Expected result & examples

Suppose there are two indicators i1 and i2, we can use the IF statement to check which value is greater. For example if i1 is greater than i2 then we can take the value of i1, otherwise take the value of i2

AND and OR


We can use AND and OR keywords to add logical conditions to one IF statement.


Syntax:

1 if( condition_1 AND condition_2, value_if_true , value_if_false)
1 if( condition_1 OR condition_2, value_if_true , value_if_false)