Database

How To Find Week Number Of A Month In Notion

notion-formula-week-month-date.png

⚙️ Week Formula

There is one date formatting dilemma that I always wanted to tackle and that is finding the week of a month from a date property. Below are two examples on how to find this. First, is if the weeks start on a monday. The second is if the weeks start on a sunday. I also show you a breakdown of the monday Notion formula if you’re interested in how it works.

Link to example below

Properties

  • Date

  • Formula

Find Week Of Month: Weeks Start On A Sunday

ceil((date(prop("Date")) + day(dateSubtract(prop("Date"), date(prop("Date")) - 1, "days"))) / 7)

Find Week Of Month: Weeks Start On A Monday

ceil((date(prop("Date")) + day(dateSubtract(prop("Date"), date(prop("Date")) - 1, "days")) - 1) / 7)

Breakdown:

  • ceil((date(prop("Date")) + day(dateSubtract(prop("Date"), date(prop("Date")) - 1, "days")) - 1) / 7)

    • Step 1: Find the date number (ie. Jan 6, 2021)



  • ceil((date(prop("Date")) + day(dateSubtract(prop("Date"), date(prop("Date")) - 1, "days")) - 1) / 7)

    • Step 2: Find the weekday number from the first day of the date’s month. (ie. Sun = 0 and Sat = 6). For example, if the date is Jan 6, 2021 … find what weekday Jan 1 lands on.



  • ceil((date(prop("Date")) + day(dateSubtract(prop("Date"), date(prop("Date")) - 1, "days")) - 1) / 7)

    • Step 3: Subtract 1 from the weekday number found previously. This will help signal each week starting on Monday.



  • ceil((date(prop("Date")) + day(dateSubtract(prop("Date"), date(prop("Date")) - 1, "days")) - 1) / 7)

    • Step 4: (Step 1 + Step 2 - 1).



  • ceil((date(prop("Date")) + day(dateSubtract(prop("Date"), date(prop("Date")) - 1, "days")) - 1) / 7)

    • Step 5: Divide the result of Step 4 by 7.



  • ceil((date(prop("Date")) + day(dateSubtract(prop("Date"), date(prop("Date")) - 1, "days")) - 1) / 7)

    • Round the result from Step 5 to the highest number.