For example, to get the last Thursday of a month, set dow to 5.
Note: I ran into this formula in ananswer on the MrExcel forum by Barry Houdini.
By default, WEEKDAY returns 1 for Sunday and 7 for Saturday, but this is configurable.
it’s possible for you to use the WEEKDAY function inside other formulas to check the day of week.