ReferenceFunctionsLogical Functions
IF
IF: Returns one value when a condition is TRUE and another when FALSE.
Summary
IF(condition, value_if_true, [value_if_false]) supports two or three arguments.
Remarks
- Condition coercion: booleans are used directly, numbers use
0as FALSE and non-zero as TRUE. - A blank condition is treated as FALSE.
- Text or other non-numeric/non-boolean conditions return
#VALUE!. - With only two arguments, the FALSE branch defaults to logical
FALSE.
Examples
Numeric condition
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
yes
Two-argument IF defaults false branch
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
false
Related functions
FAQ
What is returned when IF has only two arguments and condition is FALSE?
The false branch defaults to logical FALSE when value_if_false is omitted.
Runtime metadata
Category
Logical
Signature
IF(arg1, arg2, ... argN: Any)This function accepts a repeating argument pattern (min args: 2).
Arity
min 2, max variadic
Arguments
arg1Any · Scalar
Caps
PURESHORT_CIRCUIT
Source