Excel has a function to find the last day of the month. To find the last weekday of the month you can combine a couple of functions. Here is a custom function that also works.
If you are new to custom functions check out this post which has a detailed example.
The formula to return the last weekday of the month based on a date is something like.
=WORKDAY(EOMONTH(A1,0)+1,-1)
We can create a LAMBDA version like this.
=LAMBDA(d,WORKDAY(EOMONTH(d,0)+1,-1))(A1)
The custom function called fnEOMWEEKDAY is.
=fnEOMWEEKDAY(A1)
The New Name dialog to create the custom function is shown below.
The examples are shown below. The formula in column B is shown in column C.
Why the +1 and -1 in this formula…
=WORKDAY(EOMONTH(A1,0)+1,-1)
Wouldn’t this also work..
=WORKDAY(EOMONTH(A1,0),0)
Hi Rick
Sorry that gave me 31/12/22 which is a Saturday.
The +1 takes it to the 1st of the next month and -1 gives you the 1 workday less than that which is 30/12/22 – a Friday.
Regards
Neale