🐟 Special Sort
Sorting years is always tricky when dealing with BCE, however, with this Notion formula it will take only 3 easy steps to create a simple functional timeline. In this example, there is one Text property (year an event occurred), and one Formula property to configure this text into sortable numbers.
Why The Default Sort Doesn’t Work
A timeline needs to be sorted Descending for BCE and Ascending for CE. A simple fix is to turn all years that contain BCE into negative numbers. There is a formula that can quickly extract only the numbers found in a text property: it’s called the toNumber function.
The Special Sorting BCE Formula
What You’ll Need: A Text property called “Year” and a Formula property.
Insert this formula into a Formula property:
if(contains(prop("Year"), "BCE"), unaryMinus(toNumber(prop("Year"))), toNumber(prop("Year")))
Sort Formula Property To Ascending
This Formula property can be hidden after configurations are complete for a clean look.
Extra Tip: The toNumber and unaryMinus functions work together to first extract the number in a text property THEN turn it into a negative number.