If A1 holds a date, the formula for calculating last Working Day of the month would be
The above formula assumes that your weekends are Saturday and Sunday.
But, if your weekends are different (e.g. in gulf countries), you can use following formula -
Where 0000110 is a 7 character string, 1 represents a weekend and 0 is a working day. First digit is Monday and last digit is Sunday. The above example is for Gulf countries where Friday and Saturday are weekends.
You also have option to give a range which has holidays. In that case, your formula would become
Where range D1:D10 contains the list of holidays.