40% OFF! — Limited Time Offer
← Back to Articles

July 19, 2026

·By El Alaoui Mohamed

Revit IF Statements: Build Families That Make Decisions

Revit IF statement conditional logic with AND OR NOT examples

TL;DR

IF(condition, value_if_true, value_if_false) lets a family choose between values based on a condition. Combine conditions with AND(), OR(), and NOT(). Both branches must return the same parameter type. Nest IFs for more than two outcomes, but stop at three levels — beyond that, switch to a lookup table. The three killer errors: missing units on constants, mismatched branch types, unbalanced parentheses.

Key Takeaways

  • IF has exactly three parts: condition, value_if_true, value_if_false.
  • AND(), OR(), and NOT() combine multiple conditions into one decision.
  • Both branches must return the same parameter type — length with length, number with number.
  • Three nesting levels is the practical maximum; a lookup table replaces deeper stacks.
  • IF cannot set materials directly — use the two-geometry visibility workaround.
  • A Yes/No condition like Width > 900mm is itself a formula — no IF needed for pure toggles.

Arithmetic makes a family resize. Conditional logic makes it decide. A door that flips its swing angle, a bracket that upgrades itself when the load span grows, a rail that appears only above a certain height — all of it runs on one function with three parts.

The Syntax

IF(condition, value_if_true, value_if_false)
PartWhat it isExample
conditionAnything that evaluates to yes/noWidth > 900mm
value_if_trueReturned when the condition holds800mm
value_if_falseReturned otherwise600mm

The one unbreakable rule: both branches must return the same parameter type. A length in one branch and a bare number in the other makes the whole formula invalid.

AND, OR, NOT — Combining Conditions

IF(AND(Width > 900mm, Height > 2100mm), 125mm, 100mm) IF(OR(Is_Fire_Rated, Is_Acoustic), 54mm, 44mm) IF(NOT(Has_Sidelight), Frame_Width, Frame_Width + Sidelight_Width)

AND() requires every condition to be true, OR() requires at least one, NOT() inverts. They nest inside each other for compound rules — “fire-rated and (wide or tall)” — but each added operator doubles the mental load. Keep compound conditions to two operators where you can.

Five Real Use Cases

1 — Door Swing Direction

Swing_Angle = IF(Swing_Inward, 90°, -90°)

2 — Visibility Above a Height Threshold

A top rail appears only when the family is tall enough (assign to the geometry's Visible property):

Show_Top_Rail = Overall_Height > 2100mm

Note there is no IF here — a comparison already returns yes/no. Wrapping it in IF(x, 1, 0) is redundant. Chapter 7 is entirely about this pattern.

3 — Minimum Dimension Guard

Clear_Depth = IF(Nominal_Depth - Frame < 150mm, 150mm, Nominal_Depth - Frame)

4 — Hardware Upgrade by Weight

Hinge_Count = IF(Leaf_Weight > 60, 4, 3)

5 — Conditional Material (the Workaround)

Material parameters can't be driven by IF. Model the geometry twice with different materials and toggle visibility instead:

Show_Painted = Finish_Code = 1 Show_Raw = NOT(Finish_Code = 1)

Nested IFs: The Three-Level Ladder

Level 1 — two outcomes

Frame_Width = IF(Door_Width < 900mm, 75mm, 100mm)

Level 2 — three outcomes

Frame_Width = IF(Door_Width < 900mm, 75mm, IF(Door_Width < 1200mm, 100mm, 125mm))

Level 3 — four outcomes

Frame_Width = IF(Door_Width < 900mm, 75mm, IF(Door_Width < 1200mm, 100mm, IF(Door_Width < 1500mm, 125mm, 150mm)))

Past level 3, adding one more size means rewriting the entire chain, and nobody — including future you — can safely maintain it. That is exactly the job of lookup tables: hundreds of conditions, zero nesting.

The Three Errors That Break IF Formulas

1 — Missing Units on Constants

❌ IF(Depth > 300mm, Depth - 50, 150mm) ← 50 has no unit ✓ IF(Depth > 300mm, Depth - 50mm, 150mm)

2 — Mismatched Branch Types

❌ IF(Is_Large, Total_Width, 2) ← length vs number ✓ IF(Is_Large, Total_Width, 600mm)

3 — Unbalanced Parentheses

❌ IF(A > 0mm, 100mm, IF(B > 0mm, 200mm, 300mm) ← one ) short ✓ IF(A > 0mm, 100mm, IF(B > 0mm, 200mm, 300mm))

Count opening and closing parentheses before saving — they must be equal. When an error won't reveal itself, the systematic isolation method in the debugging chapter finds it every time.

Frequently Asked Questions

Chapter 5 of 10

Families that make decisions for you

All 10 formula chapters with worked examples, HD Video Vault, and the Formula Cheat Sheet. 40% off at $18.