All tips

Retrieve the quarter from a date

Now, I needed to group the previous database by quarter and year. Instead of doing this manually, I found a formula to achieve this.

To be clear, I didn't create this formula. I found it on Red Gregory’s excellent blog and made a few tweaks.

if(month(dateStart(prop("Start Date"))) < 4, "Q1 - " + year(prop("Start Date")), if(month(dateStart(prop("Start Date"))) < 7, "Q2 - " + year(prop("Start Date")), if(month(dateStart(prop("Start Date"))) < 10, "Q3 - " + year(prop("Start Date")), if(month(dateStart(prop("Start Date"))) < 13, "Q4 - " + year(prop("Start Date")), ""))))

It might seem intimidating, but it's simply the same process repeated four times, once for each quarter. The formula essentially determines the month from the date, and identifies the range it falls within. For instance, if it falls within the 4 to 7 range, it's Q2. I've also included the year by using the simple year() formula.

Master Notion, 5 minutes a week

Want to be in the loop with everything Notion? Join the 15,000+ Notioneers on the #1 Notion-focused newsletter.
Every Tuesday, I’ll hit you up with an email, giving you 3 tips on how to make the most of Notion, 2 (awesome) resources, and 1 Tweet of the Week.

Latest issues