I'm working on a formula that will provide the date of the 3rd Thursday of the month. That much I have working, but am trying to modify it to work for any weekday of any month. As of now the first and last weeks of the month are causing issues (returning a date from previous month, returning a date in the next week, etc.). Here is the formula I have so far:
=IF(AND([Month Week]@row = 1, DAY(TODAY()) <= 7), DATE(YEAR(TODAY()), MONTH(TODAY()), DAY([1st Monday]@row)) + ([Week Day Calculations]@row - WEEKDAY(DATE(YEAR(TODAY()), MONTH(TODAY()), DAY([1st Monday]@row) + 7))), IF(AND([Month Week]@row = 2, DAY(TODAY()) <= 14), DATE(YEAR(TODAY()), MONTH(TODAY()), DAY([1st Monday]@row) + 7) + ([Week Day Calculations]@row - WEEKDAY(DATE(YEAR(TODAY()), MONTH(TODAY()), DAY([1st Monday]@row) + 14))), IF(AND([Month Week]@row = 3, DAY(TODAY()) <= 21), DATE(YEAR(TODAY()), MONTH(TODAY()), DAY([1st Monday]@row) + 14) + ([Week Day Calculations]@row - WEEKDAY(DATE(YEAR(TODAY()), MONTH(TODAY()), DAY([1st Monday]@row) + 21))), IF(AND([Month Week]@row = 4, DAY(TODAY()) <= 28), DATE(YEAR(TODAY()), MONTH(TODAY()), DAY([1st Monday]@row) + 21) + ([Week Day Calculations]@row - WEEKDAY(DATE(YEAR(TODAY()), MONTH(TODAY()), DAY([1st Monday]@row) + 28))), ""))))
And a screenshot of the accompanying sheet:
The initial formula is based off of the one by J. Craig Williams at the bottom of this post: https://community.smartsheet.com/discussion/505/calculate-the-xth-weekday-of-any-month
Any help would be greatly appreciated & I would be happy to provide more context if needed.