IF
returns one value if condition is true, another if false
signature
IF(condition, value_if_true, [value_if_false])
returns: any
| argument | required |
|---|---|
| condition | required |
| value_if_true | required |
| value_if_false | optional |
examples
formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.
| A | |
|---|---|
| 1 | 10 |
fx
=IF(A1>100, "High", "Low") Low | A | B | |
|---|---|---|
| 1 | 10 | 2 |
fx
=IF(A1>5, B1, 0) 2