<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" /> This example database finds the number of weekend days between two dates. If the starting and/or ending date is a weekend day, it is included in the count.
Created by Thomas Frank | Learn Notion Formulas | Notion Basics | Templates | Twitter
</aside>
Number of weekend days between two dates
// Compressed
floor((prop("Days Between") + day(prop("Date 1"))) / 7) * 2 + if(day(prop("Date 1")) == 0, 1, 0) - if(day(prop("Date 2")) == 6, 1, 0)
// Expanded
floor(
(
prop("Days Between") + day(
prop("Date 1")
)
) / 7
) * 2 + if(
day(
prop("Date 1")
) == 0,
1,
0
) - if(
day(
prop("Date 2")
) == 6,
1,
0
)