<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" /> The example database below shows several rows with random dates. The Last Weekday property displays the last weekday in that date’s month, and then the Day Name property shows which day of the week it is.

Created by Thomas Frank | Learn Notion Formulas | Notion Basics | Templates | Twitter

</aside>

Last Weekday of the Month

Last Day

dateSubtract(
	dateAdd(
		prop("Date"), 1, "months"
	), 
	date(
		dateAdd(
			prop("Date"), 1, "months"
		)
	), "days"
)

Last Weekday

if(
	day(prop("Last Day")) % 7 == 0, 
	dateSubtract(
		prop("Last Day"), 2, "days"
	), 
	if(
		day(prop("Last Day")) % 7 == 6, 
		dateSubtract(
			prop("Last Day"), 1, "days"
		), 
		prop("Last Day")
	)
)

© Thomas Frank