How to Use Formulas in Revit Family Parameters

Eight steps in Revit, or one sentence in Mira.

Do it with Mira
Quick answer

In the Family Editor, click Create tab › Properties panel › Family Types. In the Formula column next to a parameter, type an expression with exact parameter names, such as Width + 2". Click Apply to check. Formulas take arithmetic, if(), rounding and trig.

Or, just ask Mira, a free add-in, to set formulas on parameters the family already has.

The manual way

How to do it in Revit

  1. Step 1: Open the family

    Select a placed instance and click Edit Family, or open the .rfa with File tab › Open › Family. Family parameter formulas are set in the Family Editor; more in how to edit a family.

  2. Step 2: Open Family Types

    Click Create tab › Properties panel › Family Types. Each parameter shows its Value and Formula, and Search narrows a long list.

  3. Step 3: Type the formula

    Click the Formula cell next to the parameter and type the expression, such as Width + 2" for Rough Width. Parameter names are case sensitive, so Width works and width doesn't (Autodesk Help: Valid Formula Syntax and Abbreviations).

  4. Step 4: Keep the units consistent

    Both sides of + or - must be the same kind of unit, so add a length to a length. Give every constant its unit, such as 2" or 50 mm, or Revit guesses one for you (Autodesk Help: Troubleshooting: Formulas for Dimensions).

  5. Step 5: Use if() for choices

    Write if(condition, value if true, value if false), for example if(Width < 3', 2", 3"). Conditions use <, > and =, with and, or and not; Autodesk notes <= and >= aren't implemented, so write not(a > b) for a <= b (Autodesk Help: Use Conditional Statements in Formulas).

  6. Step 6: Round to whole numbers

    round(), roundup() and rounddown() need a unitless number. To round a length up to the next inch, divide by 1" and multiply back: roundup(Width / 1") * 1".

  7. Step 7: Apply and flex

    Click Apply to watch the geometry follow, then switch types or change the driving values to test it. A parameter whose formula uses two or more other parameters turns gray and changes only through them (Autodesk Help: Use Formulas for Numerical Parameters).

  8. Step 8: Load it into the project

    Click Create tab › Family Editor panel › Load into Project to update the project's copy. Save the .rfa too if the change should reach other projects.

What to watch for

Yes/No needs only the condition. For a Yes/No parameter, the condition is the whole formula: Lights > 1 turns it on when there's more than one light, with the true and false results implied.

Type parameters rarely need if(). A type already works like a condition: this type, this value. Autodesk suggests saving conditionals for instance parameters that don't vary continuously; to add sizes instead, see how to add a family type.

Text results need quotes. if() can return text, as in if(Length > 35', "Long", "Short"), but both results must be the same kind of value: two lengths, two Yes/No values or two strings.

Skip dashes in names. Autodesk recommends not using a dash in parameter names. In a formula, Rough-Width reads like Rough minus Width.

Older array formulas carry a workaround. Before Revit 2025, an array needed a count of 2 or more, so older families often add +1 or an if() to keep it there. From 2025, arrays flex to 1 or 0.

A fixed formula lives in one copy. Someone fixes a rough opening formula in one project's door, and the firm's .rfa and every other project keep the old one. Over time the same door carries different rough openings, and the schedules disagree. Revit family management keeps the approved version marked, so a fix made once reaches the next project.

Or, just ask Mira to do it.

Mira is an AI thinking partner for Revit that automates the work you repeat and builds tools your team needs.

  • Type this in Mira

    In this door family, set Rough Width to Width + 2" and Rough Height to Height + 1".

    Open the door family in the Family Editor first. Mira lists the family's parameters, sets both formulas and reads them back, but Rough Width and Rough Height have to exist already, since Mira won't create parameters. It writes a small tool for the change, which asks Allow first.

EfficiencySet rough opening formulas in a Revit door family
Riverside_Medical_Center_ARCH.rvt — Exterior
FileArchitectureStructureAnnotateAnalyzeViewManagePirros
Exterior ×A-501 Details3D View
Door typeRough opening
32" x 84"34" x 85"
36" x 84"38" x 85"
36" x 96"38" x 97"
42" x 96"44" x 97"
4 types rough openings follow the door size
Mira by PirrosExterior
Pirros
ChatSkillsHistory
In this door family, set Rough Width to Width + 2" and Rough Height to Height + 1".
Reasoning
Thought for 3s
ListParams(Door-Single-Flush)
24 parameters, all 4 found
Plan(2 formulas)
Approved
SetFormula(Rough Width, Rough Height)
Set, read back
Formulas set2 of 2
Rough Width
Width + 2"
Rough Height
Height + 1"
Types updated
4
Undo
one step
Message Mira
Mira can make mistakes. Verify before you commit.
FAQ

Frequently asked questions.

Can't find what you're looking for?
Get in touch.

In the Family Editor, open Create tab › Properties panel › Family Types and type the expression in the Formula column next to the parameter. Use the other parameters' exact names, such as Width + 2".

Use if(condition, value if true, value if false), such as if(Width < 3', 2", 3"). Both results must be the same kind of value, and you can nest one if() inside another.

The two sides of an addition or subtraction aren't the same unit type, or a constant has no unit and Revit guessed a different one. Give each constant its unit, such as 2" or 50 mm.

Autodesk's help says <= and >= aren't implemented in conditional statements. Write not(a > b) for a <= b, and not(a < b) for a >= b.

A formula drives it, and when the formula uses two or more other parameters, its value can only change through them. Clear the formula to type a value again.

Parameter names are. A parameter named Width must be typed as Width; width won't be recognized.

Two ways in

Try it yourself.
Or bring it to the firm.

The download is free and takes a minute. The firm conversation is where your standards, your library, and your rollout get built. Start wherever makes sense.

Talk to us about your firm