Mastering Revit Family Formulas — $30

Free reference

Revit Formula Reference

Every function and operator available in Revit family formulas, with the syntax that actually works, a real example, and the mistake people make with it. No sign-up, no email, no paywall — bookmark it or share it in a forum answer.

29 functions and operators7 categoriesUpdated for current Revit versions

29 of 29 shown

Operators

The five arithmetic operators every formula is built from.

+ Addition

a + b

Adds two values. Both must be the same unit type — length plus length, number plus number.

Overall_Width = Panel_Width + 2 * Frame_Thickness

Total width of a panel plus the frame on both sides.

Watch out: Adding a bare number to a length gives "inconsistent units". Write 50mm, not 50.

Read more: Arithmetic in Revit formulas

− Subtraction

a - b

Subtracts one value from another. Can return a negative result, which most parameters reject.

Clear_Width = Opening_Width - 2 * Jamb_Width

Clear opening once both jambs are taken off.

Watch out: If the result can go negative, wrap it in abs() — a Length parameter cannot be negative.

Read more: The abs() function

× Multiplication

a * b

Multiplies two values. Multiplying two lengths produces an area, not a length.

Panel_Height = Panel_Width * 1.618

Golden-ratio proportion driven from a single width input.

Watch out: Length × Length = Area. Assigning that to a Length parameter fails. Multiply a length by a plain number instead.

Read more: Arithmetic in Revit formulas

÷ Division

a / b

Divides one value by another. Length ÷ Length gives a unitless number.

Leg_Spacing = (Table_Length - 2 * End_Offset) / (Leg_Count - 1)

Even spacing between legs, whatever the leg count.

Watch out: Division by zero breaks the family. If a divisor can reach zero, guard it with an IF.

Read more: Arithmetic in Revit formulas

^ Exponent

a ^ b

Raises a value to a power. Mostly used to square a length inside a Pythagorean calculation.

Diagonal = sqrt(Width ^ 2 + Height ^ 2)

Diagonal of a rectangle from its two sides.

Watch out: The exponent must be a plain number. Width ^ Height is meaningless and will be rejected.

Read more: Arithmetic in Revit formulas

Math

Absolute value, square roots, powers and constants.

abs()

abs(value)

Returns the value without its sign. The standard way to stop a subtraction going negative.

Vertical_Offset = abs(Connector_1_Height - Connector_2_Height)

Distance between two connectors regardless of which is higher.

Watch out: abs() hides the direction of a difference. If you need to know which value was larger, test it with IF first.

Read more: The abs() function

sqrt()

sqrt(value)

Square root. Almost always used to get a diagonal or a resultant length.

Brace_Length = sqrt(Rise ^ 2 + Run ^ 2)

True length of a diagonal brace from its rise and run.

Watch out: The input must not be negative. Use abs() inside if the value could go below zero.

Read more: Arithmetic in Revit formulas

pi()

pi()

The constant π (3.14159…). Needs the empty brackets — pi on its own is not recognised.

Rail_Length = 2 * pi() * Bend_Radius

Circumference of a curved rail from its radius.

Watch out: Writing pi without brackets is the most common cause of "invalid formula" here.

Read more: Trigonometric functions

exp()

exp(value)

Raises e to the given power. Rare in building geometry; occasionally used in curve fitting.

Watch out: The input is a plain number, not a length.

log()

log(value)

Logarithm. Rare in family formulas — worth knowing it exists so you recognise it in inherited content.

Watch out: The input must be a positive plain number.

Rounding

Snap a calculated value to a manufacturing module.

round()

round(value)

Rounds to the nearest whole number. To snap to a module, divide, round, then multiply back.

Coursed_Height = round(Requested_Height / 75mm) * 75mm

Snaps a wall height to the nearest 75 mm brick course.

Watch out: round() on a raw length gives "inconsistent units" — it needs a unitless number, so divide by a unit first.

Read more: Rounding functions

roundup()

roundup(value)

Always rounds up. The right choice for counting anything you cannot buy a fraction of.

Sheet_Count = roundup(Wall_Length / Sheet_Width)

You cannot order 4.2 sheets — you order 5.

Watch out: roundup(4.0) stays 4. It only rounds up when there is a remainder.

Read more: Rounding functions

rounddown()

rounddown(value)

Always rounds down. Use it when you are asking how many fit in the space available.

Locker_Count = rounddown(Available_Width / Locker_Module)

Only whole lockers fit — the remainder is left over.

Watch out: Chaining several rounding steps compounds the error. Round once, at the end.

Read more: Rounding functions

Trigonometry

Angles, slopes, braces and anything on a diagonal.

sin()

sin(angle)

Sine of an angle. Gives the vertical component of a sloped member.

Brace_Length = Height / sin(Brace_Angle)

True length of a brace from its vertical height and angle.

Watch out: The input must be an Angle parameter, not a plain number.

Read more: Trigonometric functions

cos()

cos(angle)

Cosine of an angle. Gives the horizontal component of a sloped member.

Horizontal_Reach = Brace_Length * cos(Brace_Angle)

How far a brace reaches horizontally.

Watch out: cos(90°) is zero — dividing by it breaks the family.

Read more: Trigonometric functions

tan()

tan(angle)

Tangent of an angle — the ratio of rise to run.

Rise = Run * tan(Roof_Pitch)

Height gained across a given horizontal run.

Watch out: tan(90°) is undefined. Constrain the angle if a user can type freely.

Read more: Trigonometric functions

atan()

atan(number)

Inverse tangent — turns a rise-over-run ratio back into an angle.

Slope_Angle = atan(Rise / Run)

The angle of a ramp from its two dimensions.

Watch out: The input is a unitless ratio, so Rise and Run must both be lengths and divide cleanly.

Read more: Trigonometric functions

asin()

asin(number)

Inverse sine. Returns the angle whose sine is the given ratio.

Half_Angle = asin((Chord / 2) / Radius)

Half the included angle of an arc from its chord and radius.

Watch out: The input must be between −1 and 1. Anything outside that has no answer and the formula fails.

Read more: Trigonometric functions

Conditional logic

Make a family decide between values.

IF()

IF(condition, value_if_true, value_if_false)

Chooses between two values. Exactly three parts — condition, result when true, result when false.

Handle_Height = IF(Door_Height > 2100mm, 1050mm, Door_Height / 2)

Tall doors get a fixed handle height; shorter ones get a centred one.

Watch out: Both branches must return the same parameter type. A length in one and a number in the other will not compile.

Read more: IF statements in Revit

AND()

AND(condition1, condition2)

True only when every condition is true. Used inside the first slot of an IF.

IF(AND(Width > 900mm, Height > 2100mm), 1, 0)

Only wide AND tall openings qualify.

Watch out: AND() is not a value on its own — it belongs inside an IF condition.

Read more: IF statements in Revit

OR()

OR(condition1, condition2)

True when at least one condition is true.

IF(OR(Is_Fire_Rated, Is_Acoustic), 54mm, 44mm)

Either requirement triggers the thicker leaf.

Read more: IF statements in Revit

NOT()

NOT(condition)

Reverses a condition. Also the workaround for the missing ≤ and ≥ operators.

IF(NOT(Width > 1200mm), 1, 0)

True when Width is 1200 mm or less — i.e. the ≤ Revit does not give you.

Read more: IF statements in Revit

Yes/No output

IF(condition, 1 = 1, 1 = 2)

Drives a Yes/No parameter from a formula. 1 = 1 is always true, 1 = 2 always false.

Needs_Mullion = IF(Panel_Width > 1500mm, 1 = 1, 1 = 2)

Ticks a checkbox automatically once a panel exceeds the limit.

Watch out: Returning 1 and 0 does not work for a Yes/No parameter — it needs a true/false expression.

Read more: Yes/No parameter formulas

Comparison

The operators that build a condition — and the two Revit does not have.

= Equal to

a = b

Tests exact equality. Reliable for integers and Yes/No, risky for calculated lengths.

Watch out: Never test two calculated lengths for equality — floating-point rounding means they rarely match exactly. Compare against a tolerance instead.

Read more: Troubleshooting formulas

≤ and ≥ (not supported)

NOT(a > b) / NOT(a < b)

Revit has no ≤ or >= operator. Wrap the opposite comparison in NOT() instead.

IF(NOT(Height > 2400mm), 1 = 1, 1 = 2)

True when Height is 2400 mm or less.

Watch out: Typing >= or <= produces "invalid formula" with no explanation of why.

Read more: Troubleshooting formulas

Lookup

Drive a family from an external table instead of nested IFs.

size_lookup()

size_lookup(table, "column", default, input1, input2, …)

Reads a value from an external CSV lookup table. Replaces deeply nested IFs when a family has many size variants.

Flange_Thickness = size_lookup(Fitting_Table, "Flange_T", 10mm, Nominal_Diameter)

Pulls the correct flange thickness for the given diameter from the table.

Watch out: The default value is returned silently when no row matches — so a typo in the table looks like a working family with wrong numbers.

Read more: Lookup tables and CSV

Questions people ask most

Frequently Asked Questions

Stuck on a formula? Ask me.

Paste the formula that is not working and what you expected it to do. I read every question and reply by email — no account, no forum to join.

Your email is only used to answer you. If the answer helps others I may publish it — never with your name or email.

Want the worked examples behind these?

This reference tells you what each function does. Mastering Revit Family Formulas shows you how to combine them into families that survive real projects — ten chapters of worked examples, an HD video vault, and a printable cheat sheet.

🛡️ 30-day money-back guarantee  ·  ⚡ Instant delivery