I’m working with a Notion database where I have a rollup property called “Task Metrics” that pulls multiple numeric values from a related database. This rollup contains several numbers that come from a formula property in my Projects database.
I need to create a formula that can calculate the average of all these values within the rollup property. The challenge is that rollup properties in individual database records don’t have the built-in Sum or Average calculation options that rollup columns normally provide.
I’ve attempted using .toNumber() but this only grabs the first value from the collection. I also tried .format() without success. What I really need is a way to both sum all the numbers and count how many values exist so I can determine the mean.
Has anyone found a working solution for performing calculations on rollup property arrays in Notion formulas?
I hit this same issue building a client dashboard last month. Here’s what worked for me: don’t try to manipulate the rollup array directly. Instead, create a formula property in your Projects database that does the math before the rollup happens. The formula calculates sum and count within each project record, then formats them as text with a delimiter like “sum|count”. In your main database, the rollup grabs these formatted strings. Then you just use slice() and toNumber() to extract and divide the values. Takes some text manipulation, but it’s actually faster than multiple rollup properties since you’re only dealing with one rollup column.
I encountered a similar problem while creating my own project tracker. What ended up working for me was adding two separate rollup properties in the database. The first rollup sums your Task Metrics values, while the second counts the total entries. You can then implement a formula that divides the sum by this count to calculate the average. Although this approach requires adding extra properties, the benefits are that the calculations will update automatically as your data changes. The formula would look something like prop("Sum Rollup") / prop("Count Rollup"). I’ve applied this technique in multiple databases, and it has proven reliable.
totally agree! like, having separate rollups for sum and count is a workaround but it gets the job done. not ideal, but it’s what we gotta do for now. hope they improve this feature in future updates!