IF
The most important function for building ConvertSites with conditional logic.
IF is your "if this, then that" function. Use it whenever different inputs should produce different results: pricing tiers, discount rules, qualification messages, or any scenario where the answer depends on what someone enters.
How it works
IF(condition, value_if_true, value_if_false)condition- Any expression that results in TRUE or FALSE (likePRICE > 100orSCORE >= 80)value_if_true- What to return when the condition is TRUEvalue_if_false- What to return when the condition is FALSE (optional, defaults to FALSE)
Basic example
Volume discount threshold
You sell products at €100 each and want to apply a 5% discount when orders exceed €1,000.
First, calculate base price:
PRICE * QUANTITYThen add the discount condition:
IF(
PRICE * QUANTITY > 999,
PRICE * QUANTITY * 0.95,
PRICE * QUANTITY
)This checks if the total exceeds €999. If yes, apply 95% (5% discount). If no, use full price.
Chaining multiple conditions
Tiered discount structure
You want different discounts at different order values:
€1,000+: 5% discount
€1,500+: 10% discount
€2,500+: 15% discount
€5,000+: 20% discount
First, create a variable for total price to keep formulas readable:
TOTAL_PRICE = PRICE * QUANTITYThen chain IF statements:
IF(TOTAL_PRICE > 4999, TOTAL_PRICE * 0.80, 0) +
IF(AND(TOTAL_PRICE > 2499, TOTAL_PRICE < 5000), TOTAL_PRICE * 0.85, 0) +
IF(AND(TOTAL_PRICE > 1499, TOTAL_PRICE < 2500), TOTAL_PRICE * 0.90, 0) +
IF(AND(TOTAL_PRICE > 999, TOTAL_PRICE < 1500), TOTAL_PRICE * 0.95, 0) +
IF(TOTAL_PRICE < 1000, TOTAL_PRICE, 0)Each line checks a price range and returns the discounted price for that tier, or 0. The + adds them together so only the matching tier returns a value.
Show which discount was applied:
IF(TOTAL_PRICE > 4999, "20% discount", "") &
IF(AND(TOTAL_PRICE > 2499, TOTAL_PRICE < 5000), "15% discount", "") &
IF(AND(TOTAL_PRICE > 1499, TOTAL_PRICE < 2500), "10% discount", "") &
IF(AND(TOTAL_PRICE > 999, TOTAL_PRICE < 1500), "5% discount", "") &
IF(TOTAL_PRICE < 1000, "No discount", "")Use & for text values and "" for empty text (not 0).
Combining with AND/OR
Discount with exclusions
Give 20% discount when buying 5+ products, but only for Silver or Gold finish (not Platinum).
IF(
AND(QUANTITY > 5, OR(FINISH = "Silver", FINISH = "Gold")),
TOTAL_PRICE * 0.8,
TOTAL_PRICE
)This checks two conditions: quantity over 5 AND finish is either Silver OR Gold.
Common mistakes
Wrong parameter order - Make sure value_if_true comes before value_if_false
Space before parenthesis - Use
IF(notIF (or it will errorInconsistent value types - Returning a number in one branch and text in another can cause issues unless you're just displaying the result
Missing closing bracket - Each IF needs a closing
), and accidentally adding+at the end will errorToo many nested IFs - After 3-4 levels, switch to IFS function or use lookup tables with VLOOKUP/FINDIFS
When to use alternatives
3+ conditions: Use IFS function instead of chaining
Many variable rules: Use lookup tables with VLOOKUP or FINDIFS
Complex logic: Break into multiple variables first, then use IF
Related functions
Logical Functions - IFS, AND, OR, NOT