Logical

If

Returns one result when a condition is true and another when it is false.

Syntax

If(Condition, ThenResult [, Condition2, ThenResult2, ...] [, DefaultResult])

Parameters

Condition
A formula that evaluates to true or false.
ThenResult
The value returned when the matching condition is true.
DefaultResultoptional
Returned when no condition is true. Blank if omitted.

Examples

  1. =If(Score >= 90, "A", Score >= 75, "B", "C")

    Checks conditions in order and returns the first match

Maker notes

  • Conditions are checked from left to right; evaluation stops at the first true one.
Official documentation on Microsoft Learn

↑ ↓ moveEnter open