Skip to main content

Building Advanced Formulas in Analytics

Written by Holly Conrad Smith

Real estate math is rarely a straight sum. Parking ratios round up, affordable set-asides only apply above a unit threshold, and FAR needs a clean ratio. Advanced formulas let one calculation handle those rules so your yield and feasibility numbers stay right as the design changes.

Where formulas live

Every calculation has a Formula field in its Calculation section. Each component in the Components section gets a letter, starting with A, B, C, and D. Write the formula with those letters. The result preview under the formula updates as you type.

Learn how to create a calculation and how to add components before you write a formula.

Round up with ceil

Use ceil(x) to round a value up to the next whole number. A parking code that asks for one space per 300 square feet of floor area always needs a whole space. If A is floor area in square feet, write ceil(A / 300).

Use floor(x) to round down instead. Use round(x) or int(x) to round to the nearest whole number.

Round to decimal places with roundTo

Use roundTo(x, n) to round a value to n decimal places inside a formula. If A is gross floor area and B is site area, roundTo(A / B, 2) gives FAR to two decimal places.

The Precision setting in the calculation's Information section controls how many decimals the result shows. Use roundTo when the rounded value itself needs to feed the math.

Write an if statement

Use the form test ? value if true : value if false to apply a rule only when a condition is met. If A is a unit count and 15% of units must be affordable once a project passes 50 units, write A > 50 ? ceil(A * 0.15) : 0.

You can also write the same rule with the if function: if(A > 50, ceil(A * 0.15), 0).

Tests use ==, !=, >, <, >=, and <=.

Combine conditions with and and or

Use and to require every test to pass. Use or to pass when any test passes. If A is building height and B is unit count, A > 25 and B > 100 ? 1 : 0 returns 1 only when both limits are exceeded.

Cap a value with min and max

Use min(a, b) to return the smaller of two values and max(a, b) to return the larger. If A is the floor area you drew and B is the maximum floor area zoning allows, min(A, B) counts only the allowable area. Use max(A - B, 0) to measure how far a design goes over a limit, with zero when it fits.

Control order of operations

Wrap parts of a formula in parentheses to set the order they solve in. (A + B) * 0.1 adds the two components first, then takes 10% of the total.

Find every operator and function in the full list of formula functions.

Did this answer your question?