Salesforce IF Formula: Syntax, Nested IF, AND, OR and NOT Examples

The Salesforce IF formula tests one condition and returns one value when it is true and another when it is false:

IF(logical_test, value_if_true, value_if_false)

IF works in formula fields, validation rules, approval processes and default values. Below: 11 copyable formulas, NOT on its own, IF versus CASE, and the first two editor errors you will hit. Four formulas ran on five partner accounts in a Winter ’27 Developer Edition org.

This Tutorial Covers: