Ask Runway AI Copilot

Writing formulas

Formulas are human-readable, only need to be entered once, and don’t have to be remembered—so everyone in your organization can easily work with them.

Understanding formulas

Formulas that anyone can understand

With Runway, you can write formulas that anyone can understand.

Human-readable formulas use natural language labels for drivers, instead of cell references, so ‘Runway 🛫’ becomes ‘Cash 💵’ divided by ‘Burn 🔥’:

Notion image

Formulas you don’t have to remember

In Runway, formulas are unique and only have to be entered once to be used anywhere across the platform.

Once you’ve entered the formula for ‘Burn 🔥’, you can easily reference that driver in any model, on any page, or in charts to calculate or visualize. No need to remember the cell or re-enter the same formula each time.

Formulas that show values as time series

Unlike spreadsheet formulas that are cell-based, Runway formulas are row-based.

Each driver has a unique formula that shows its values as a time series, and uses different data sources to calculate past and future values.

  1. Actuals are calculated using data pulled from integrations or other drivers, or data that’s been manually added.
  1. Forecasts are calculated based on data from driver formulas and plans.

While building a model, you can use either a forecast and or an actual formula for a given time period. Each formula affects different parts of the time series.

Working with formulas

Creating a forecast formula

Forecast formulas calculate future values. For example, say you want to create a formula to calculate the ‘Months of Runway 🛫’:

Notion image
  1. Go to the cell in your model that contains the ‘Months of Runway 🛫’ driver. If you don’t have the correct driver in your model, follow these steps to create one.
  1. Double-click on the Forecast Formula column to the right, and enter your formula.
💡
When you create a new driver, a forecast formula will appear by default in the form of “[Name of driver] Last month”. You can double-click on the formula to update it.
💡
You can override forecast values with plans.

Creating an actual formula

Let’s say you want to use your QuickBooks integration to create an actuals formula for ‘Months of Runway 🛫’. This is how it would look:

Notion image
  1. To add an actuals formula, double-click on the Actuals Formula column to the right of the driver.
  1. Next, link the actuals or historical data from your integrations or databases. They’ll appear in the External Drivers section of the autofill as you type, and can be identified by the icon or logo for your tool.
Notion image
  1. Once your actuals are populated, you can also override them by manually entering values into cells.
💡
The actuals formula will inherit the forecast formula unless otherwise specified.

Using operators in formulas

You can use these typical operators in your formulas:

+ for addition

- for subtraction

* for multiplication

/ for division

Runway also supports a variety of mathematical functions to perform complex calculations without extensive manual work. You can access these frequently-used options in the Functions section of the autofill as you type:

Function name
Syntax
Usage
sum()
sum(reference)
Returns the sum of a database field or dimensional driver reference.
count()
count(reference)
Returns the number of values in a database field or dimensional driver reference.
if()
if(logical_expression, value_if_true, value_if_false)
Returns one value if a logical expression is true and another if it is false.
round()
round(value, [places])
Rounds a number to a certain number of decimal places according to standard rules.
min()
min(reference…)
Returns the numerical minimum value in a database field, dimensional driver reference, or set of numeric evaluations.
max()
max(reference…)
Returns the numerical maximum value in a database field, dimensional driver reference, or set of numeric evaluations.

You can apply the operators and functions to:

  • Individual drivers (e.g. cash/burn).
  • Driver groups (e.g. summing all the values of a driver group with sales expanded by a specific dimension).
  • Databases (e.g. counting the number of employees in one department).

Editing a formula

To edit an existing formula, you have 3 options:

  • Double-click on the formula cell.
  • Click the 𝑓 symbol that appears next to the driver's name when hovering over the corresponding cell.
  • From the detail view of a driver, click on the formula.
 

Default Formulas

  • Setting defaults for formulas over large datasets can save a lot of time — when you have several drivers you expect to model similarly, or when you want new segments added to a database to get the same formula, you can use the default formulas for drivers.
  • In databases, the entire driver column can have a default formula, and any individual driver within the column can override the inherited default. To revert back to the default, just clear / backspace over the overridden formula.
  • Formulas inherited from a default are indicated with a lightened presentation.
  • In the formula editor, hovering will indicate where the formula is being inherited from. The order of priority of formula inheritance is:
    • [Top Priority] Actuals Formula for a specific driver
    • Forecast formula for a specific driver
    • Actuals formula for the driver column, applying to all drivers with the same segmentation.
    • [Fallback] Forecast formula for the driver column, applying to all drivers with the same segmentation.
  • For example, if only the forecast formula on the column is set, all other values will inherit that same formula for drivers at that segmentation
 
 

Dynamic formulas using This Segment

  • In highly dimensional models when you want to apply similar logic to each segment of your data (for example, recognizing revenue over a number of contracts), you can save time with dynamic formulas, made possible by the This Segment formula utility.
  • This Segment gives you access to other data that shares the same dimensional segment(s) as the driver you’re currently writing a formula for.
  • This allows for simple + scalable dynamic logic - writing one formula to apply to all segments in your table.
  • Note that Use of This Segment is not constrained just to one database, although using it within one database is likely the most common pattern.
    • You can use the This Segment to dynamically match dimension values anywhere in the app.
    • You can use the dimension value filters to look up and match specific attribute or driver values across databases.
 

Let’s go over a few ways you can leverage This Segment to scale how you model to avoid repeated work or hard-to-trace errors.

Dynamic Defaults for consistent modeling logic

In this example, we populate a default formula that uses the This Segment utility in order to set similar logic for every segment in our database. Here’s also a diagram to explain how it works.

Notion image
 

Dynamic Filters using dimension values

You may want to leverage a partial match on the dimensional segment - e.g. picking off just one attribute from. the row. Luckily, This Segment allows for matching across just a subset of dimensions in the segment or all of them, within the filter menu. Let’s explore using an example where you want to understand the % of usage each customer consumes per product.

 

In the filter menu:

  • If you want to match across all the dimensions in the segment (e.g. match on Customer Name + Product), you can use the “Segment” filter.
  • To apply the dynamic filters individually, you can select the target dimension and then use the “This <dimension name>” option.
  • Small note: Typically, using the formula pill that has the database name in it will give you access to filter on all columns of the database, whereas picking the pill with only the driver name will only give you access to columns the driver is segmented-by. More on segmentation here.
Notion image
 
 

Dynamic Filters using driver values

The fun doesn’t end there — there’s one more capability where This Segment can let you dynamically match on driver values, allowing you to use drivers to map values.

Let’s explore an example where you want to charge a different price based on usage tier threshholds.

 

Imagine you have usage tiers that look like this, and you’re trying to figure out how much to charge each customer.

Notion image
 

To perform this match, we can simply apply a formula that multiplies

each customers # transactions * unnt price for their usage tier .

We can use our filter operators and the This Segment filter for driver values to achieve this as demonstrated below:

 

Small notes on decisions made while writing this formula:

  • To calculate the usage cost, we multiplied each customer’s monthly transactions, times the minimum unit rate from the Usage Tier Pricing table, filtered for where the unit transaction threshold was less than the the number of the customer’s monthly transactions.
  • I chose the reference to Unit Rate under the Databases section (with the bomb icon) since I’d need to filter and relate two different columns in that database.
  • I changed the default aggregator from sum() to min() because we only wanted to use the lowest monthly rate.
    • We wouldn’t want to charge a unit price of $3 + $2 + $1 for our highest usage tier customers, just $1/txn!
 
 

This Segment is quite a new feature. If you find it to be working unexpectedly, would like for it to be even more flexible, or have any feedback, please let us know!

 

Fixing formula-related errors

If you see a warning next to a formula, it means the formula contains an error. Here are the most common errors and how to fix them:

Missing operator
Locate the red underline and add the missing operator.
Missing expression at the end of formula
Add the missing expression, typically a closing parenthesis.
Formula contains deleted dependency
Replace the deleted driver with a valid one. It will be highlighted with a red outline in the formula so you can quickly identify it.
Dependency loop with driver
Rewrite the formula for the driver that’s generating the dependency loop.
 

Couldn’t find what you were looking for? Try typing your query in the search bar above, or feel free to get in touch with our support team.

Did this answer your question?
😞
😐
🤩

Last updated on July 14, 2023