Skip to content

Formula depth limit reached: your syntax is fine

5 min read
Stacks of paper documents and file folders

In the AI formula article, the error string “Formula depth limit reached” showed up at the end. The syntax can be fine. This article is about the chain underneath that error. 💯

This article is a part of the Fantastic Formulas series. This series features helpful articles about formulas in Notion.

Notion formulas can only be 15 layers deep. Every time a formula references another formula or a rollup, it adds a layer. That still counts when the other formula lives in a different database. People rewrite the syntax for hours. The syntax is fine. The graph is too deep. 👀

Today we will count what a layer is, then flatten one chain. Just like in the previous article, I will proceed with a simple database. This time, let’s say we want the number of open tasks on each project. 👀

In this database shown below, you can see 2 properties. First property shows the project name, and the second one is a relation called Tasks. ✅

Projects database with a Tasks relation Example - Simple Projects database

Launch has three tasks. Kickoff is Done. Launch review and Copy deck are still open. Northwind has Audit and Invoice, both open. Harbor has no tasks. Studio has one task, Redesign, and it is Done.

1\. What counts as a layer

Notion’s help center names the error “Formula depth limit reached.” The limit is 15 layers. The hop that counts is a reference to another formula or a rollup, not a pair of parentheses in the formula you are editing. ✅

Say the Tasks database has its own formula, Is open:

prop("Status") != "Done"

Is open, on the Tasks database

Projects then has a rollup that shows Is open. A third formula on Projects references that rollup, maybe to count the trues. That is three hops, and a real dashboard keeps adding them. A weekly report formula references the project formula. That project formula references a rollup. The rollup references Is open. Each of those references adds a layer, even though you are looking at one cell. 👀

The error appears when that chain reaches 15. Rewriting the last formula will not help if the depth is in the properties it points at.

2\. The flat count

The open-task count does not need the rollup, and it does not need Is open. The relation is already a list of pages. Filter that list, then take the length. The syntax is

prop("Tasks").filter(current.prop("Status") != "Done").length()

Open tasks, without a rollup hop

filter() keeps the related pages whose Status is not Done. length() counts what is left. This formula does not reference another formula, and it does not reference a rollup, so it does not add those layers. ✅

As you can see below, the formula is perfectly working 🔽

Open task count from the related Tasks Open count, read straight from Tasks

  • Launch → 2. Kickoff is Done, so it is not in the count.
  • Northwind → 2. Audit and Invoice are both open.
  • Harbor → 0. There are no related tasks, so the list is empty.
  • Studio → 0. Redesign is Done.

Harbor showing 0 is the honest answer. An empty relation is an empty list. length() on an empty list is 0, not a blank, and not an error. 👀

3\. Helpers that help, and helpers that add a layer

Notion’s fix is to combine the extra formulas and rollups into fewer properties. A helper is useful when it replaces a hop. It is not useful when other formulas then reference it, because that reference is a new layer. ✅

If Open is the number the dashboard needs, stop there. Do not roll Open up into a parent database and write a fourth formula that only repeats it. That fourth formula is the hop that pushes a deep workspace over 15.

The same shape shows up as progress of progress. Tasks roll up into a project formula. That formula rolls up into a parent formula. The parent rolls up into a dashboard. The syntax in the dashboard cell can be a single prop(). The depth is the chain behind it. Flatten the chain. Compute the count once, on the database that already has the relation. 👀

A view can also replace a formula you only wanted for grouping or filtering. If the only job of Is open was to feed a rollup you then counted, the filter above already did the job.


Conclusion

Now you know why Notion says Formula depth limit reached! The syntax can be fine. Each reference to another formula or rollup adds a layer, even across databases. The limit is 15. Combine those hops into fewer properties, and read the related pages directly when a rollup was only there to be counted. 🔥

I hope this article was helpful and easy to understand. At Prototion, we are on mission to make Notion easy for everyone! So we regularly post Helpful articles about Notion like this one. 📄

Remember to check out the Fantastic Formulas series for more articles about Notion formulas. Doesn’t matter if you are a Notion beginner or a pro, I believe you will find this series helpful. Also, don’t forget to follow us on 🐦 Twitter for daily updates, latest Notion template launches and amazing deals & discounts on Premium Notion templates! 😍

Short answers

What does Formula depth limit reached mean?

The syntax can be fine. The formula references other formulas or rollups more than 15 layers deep, including across databases.

What counts as a layer?

Every reference to another formula or rollup adds a layer. A formula in a different database still counts.

How do I fix a Notion formula depth limit?

Combine the extra formulas and rollups into fewer properties. Compute the number once, and do not reference that helper from another formula.

Templates that do this for you

Built by independent makers on Prototion.