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.
We can create a LAMBDA version like this.
The custom function called fnEOMWEEKDAY is.
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.