Skip to main content
Conditional logic chooses a result based on a test.

Use if

The first argument is the test. The second is the result when the test is true. The third is the result when it is false.

Comparisons

Use:
  • = for equal
  • <> for not equal
  • > and <
  • >= and <=
Example:

Combine tests

Use and, or, and not:

Nested conditions

Nested conditions are useful for a small number of clear outcomes. If the formula becomes difficult to read, consider separating the logic into Variables or using dimension-based formulas.

Handle calculation errors

Use a condition when the fallback is part of the business rule:
Use iferror when an expression can produce an error and you want a defined fallback:
Division by zero produces a cell-level error. iferror can catch that error instead of letting it propagate to dependent calculations.