I figured that if I can find the weekday of the first day on a month, I can calculate how many days it will take to next friday. If I subtract the difference from the total number of days in a month, divide the result by 4 and add 1 for the first friday, it should work. The only question is, how do I get the weekday (as a number) from the string "friday" (or another day). Wouldn't want to use Switch, because depending on a user's locale, the weekday 1 could be sunday or monday, potentially messing up the formula.
Here are a few formulas to help (I use camel case to prevent having to use curly brackets in field names):
FirstDayOfMonth: DATETIME_PARSE(DATETIME_FORMAT(Date, "YYYY-MM-") & "01")
FirstDayOfMonthName: DATETIME_FORMAT(FirstDayOfMonth, "dddd")
LastDayOfMonth: DATEADD(DATEADD(FirstDayOfMonth, 1, "month"), -1, "day")
TotalDaysInMonth: VALUE(DATETIME_FORMAT(LastDayOfMonth, "D"))
Hi guys, I've got a similar query where I need to find out how many Saturdays are in the current month. Needs to be a formula as it's going to be a rolling thing that is linked to a monthly automation.
I've gone over this thread a few times, and I cannot for the life of me figure out how you guys pieced these together to answer the original query... 🤔
Was there a final formula based on @Steve_Haysom's combination of options that solved the issue that @Malakai was having?