Skip to main content

IF

Returns one value if a condition is true and another value if it's false.

Syntax

IF(logical_test, value_if_true, [value_if_false])

Arguments

  • logical_test: The condition to evaluate.
  • value_if_true: The value to return if logical_test is TRUE.
  • value_if_false: [Optional] The value to return if logical_test is FALSE. If omitted, returns FALSE.

Example

IF(A1>10, "Greater than 10", "Less than or equal to 10") → Returns "Greater than 10" if A1>10, otherwise returns "Less than or equal to 10"
IF(B1="Completed", "✓", "❌") → Returns a checkmark if B1 contains "Completed", otherwise returns an X