I am trying to determine if a given date is the last day of that type (Sunday, Monday, Tuesday, etc.) in its month. For example, for March of 2016, the last Friday of the month is the 25th.
Please note I am not trying to figure out what the last day of the month is. Also, 'weekday' in the question refers to any of the 7 days, not just non-weekend days.
I am using excel and php as tags because I can work with either approach.