IF
The IF function returns one value if a condition is TRUE and another value if it is FALSE.
Syntax
=IF(logical_test, value_if_true, [value_if_false])
Parameters
logical_test
: The condition to evaluatevalue_if_true
: The value to return if logical_test is TRUEvalue_if_false
: Optional. The value to return if logical_test is FALSE
Examples
=IF(A1>10, "High", "Low") // Returns "High" if A1>10, "Low" otherwise
=IF(B1="Yes", 1, 0) // Returns 1 if B1="Yes", 0 otherwise
=IF(C1>100, "Over Budget") // Returns "Over Budget" if C1>100, FALSE otherwise