<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" width="40px" /> The example database below contains several events that are happening over multiple days. The Date Range property displays their start and end dates, while the Current State formula property determines whether the event has passed, is currently ongoing, or is still in the future.
Finally, both the Table and Board views of the database are grouped by the Current State formula’s three possible outputs.
Created by Thomas Frank | Learn Notion Formulas | Notion Basics | Templates | Twitter
</aside>
Past, Present, Future Grouping
// Compressed
if(dateBetween(start(prop("Date Range")),now(),"days") > 0,"Future Events",if(dateBetween(end(prop("Date Range")),now(),"days") >= 0,"Currently Active","Past Events"))
// Expanded
if(
dateBetween(
start(
prop("Date Range")
),
now(),
"days"
) > 0,
"Future Events",
if(
dateBetween(
end(
prop("Date Range")
),
now(),
"days"
) >= 0,
"Currently Active",
"Past Events"
)
)