Notion is an exceptional tool that I have been using for quite some time. Its underlying database structure, which resembles a table, offers customization options with various views such as gallery, board, list, and calendar.
Recently, I created a simple database to track my team’s sprint progress on a weekly basis. The database includes fields for the sprint name, date, number of closed tickets, number of open tickets, and a formula column to automatically calculate the percentage of closed tickets.
The formula is straightforward: closed tickets / (closed tickets + open tickets). In Notion, you can directly reference column names in formulas. For example, I have a formula like "Complete" / ("Complete" + "Open"), which is represented as prop("Complete") / (prop("Complete") + prop("Open")) when copied and pasted.
To visualize the result, I have included screenshots below:
As you can see, the result is a long decimal number. To round it to two decimal places, we can use a workaround similar to rounding numbers in JavaScript.
Here’s the formula to round to two decimal places:
round(prop("Some column") * 100) / 100
You can adjust the number of zeros to round to the desired decimal places. For example, to round to one decimal place, use 10; to round to three decimal places, use 1000.
This is how it appears on the Notion page:
Let’s take an example where the result of the formula is 0.531914893617. When you multiply it by 100, it becomes 53.1914893617. Rounding it gives you 53. Finally, dividing it by 100 gives you 0.53.
Here’s the updated result: