All tips

Extract everything before a specific character

One of my clients maintained a simple table to track metrics weekly. The objective was to transform this table into an easy-to-read database.

However, we faced a challenge: the date format, "March 12 - 19", could not be converted into a date property since Notion doesn't support this format. Notion prefers the format "March 12, 2023".

So, my goal was to find a way to retain only the first part of the date, that is, to extract the data before the "-" character. Fortunately, there's a formula for that:

replaceAll(prop("Date"), "-.*", "")

Notion extract everything before a specific character

After formatting all the start dates, I simply copied and pasted these into a Date property, making sure to include the year. Then, using the dateRange() function we discussed earlier, I extended these dates by 7 days to create a full week date range.

Notion dateRange formula

I loove when Notion formulas saves me a ton of manual labor 🤓

Master Notion, 5 minutes a week

Want to be in the loop with everything Notion? Join the 10,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