All tips

Last Day of the Month Formula

Kavisha is going deep into the formulas 2.0 rabbit hole. Here’s what she found for getting the last day of a month in a Notion database.

‍

lets(
 /* Gets the first date of the month */
 firstOfTheMonth, dateSubtract(today(), date(today()) - 1, "days"),
 
 oneMonthAdded, dateAdd(firstOfTheMonth, 1 , "month"),
 
 /* Gets the last date of the month */
 lastDateOfThisMonth, dateSubtract(oneMonthAdded, 1 , "day"),
 
 style("» Last day of the month: ", "gray") + style(lastDateOfThisMonth.format(), "b", "default")
)

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