5 Basic Concepts About Notion Formulas To Improve Your Database

Introduction

Notion Formulas try to be like a lightweight of what Excel can provide when you work on a Worksheet but in a Notion Databases. So, it allows you to do some calculations based on the data on the page to generate a derived field. One of the components that we would like most about Notion is how easy it is and also how quickly we can do something good-looking and at the same that is functional. But, truth must be told, automation and integrations are not the most powerful capability now. Still, we must know the options at our disposal, and Notion Formulas is one of the existing capabilities we can use.

How to add a Notion Formula to your Notion Database?

You can use notion formulas as another field in your database, and you define it with a concrete type named “Formula,” as you can see in the picture below:

Notion Formulas: Add To Database

Once you select it, you will have a new field on the property configuration named “Formula” with an Edit button that allows you to define the formula:

Notion Formula: Add Formula

Notion Formula Types

With that, you will have the Formula Expression Builder at your disposal. So, what things can you do?

Notion Formulas Add Text
  • You can access the value of other properties from your page using the function prop(“name of the field”). It is essential to notice that when you are rendering another prop, it will always be rendered as a text or string without any format.
  • You can use operators to do operations and comparisons such as equal, and, or, divide, pow, mod, add, if, larger, smaller.. etc.
  • You can use functions to alter the value of the field, such as text functions (length, concat, join, slice, format, replace, replaceAll), numeric functions (floor, log10, min, max, round) and date functions (start, dateAdd, dateBetween).

For each notion formula, you will have documentation explaining what the property does and some samples to know how to use it.

Notion Formulas Use-Cases

So, after the main description and the summary about the notion formulas type available today, what are the main use-cases you can perform with this kind of object? Is that the number of use-cases is massive, and it will depend a lot on your requirements but here are a bunch of samples to free your creativity:

  • Period between dates: You can get a field with the number of time that has elapsed from one date (start date) to another one (end-date), so you can measure this time or filter by it:
5 Basic Concepts About Notion Formulas To Improve Your Database |
  • Number calculations: This is useful when you have some conditions on the measures you want to perform so you cannot rely on the aggregation formulas at the bottom of the Notion Database Table View for example you want just to count the amount of cost for each of the items of your notion database but only the things that have the status property column as Active for as you can see in the picture below:
5 Basic Concepts About Notion Formulas To Improve Your Database |
  • Unique Identifier: You want to have a field in your database that is a unique id, so you can easily do that with a basic notion formula by just calling the function id on your notion database parameter formula definition.

What is not possible today with Notion Formulas?

This will allow you to define derived fields on your pages. But, what things are not possible to do at this moment?

  • You cannot refer to other pages from the same database (there are some workarounds to try to do something similar that we will cover on other posts)
  • You cannot extend the number of functions available or inject custom code to implement things that cannot be covered with the current function set.
  • You cannot provide a custom formatting for those values in a declarative way.

So, Notion Formulas are great, and I use them all the time in my databases, but I think they have a lot of features to be added that, hopefully, this gap will be closed in the upcoming releases of the tool, so also stay tuned to this blog and the official link here.