Is there any solution for this ?
Discussion posts and replies are publicly visible
My first inclination is that you can make use of the Workday() function. For this you would pass in the last day of the month, and "-5" for the number of work days to count from.
Seems like workday(date(ri!year, ri!month + 1, 01), -5) works when the first of the month after the one you're looking at is a work day.
When it's not a work day, workday(date(ri!year, ri!month + 1, 01), -4) seems to do the trick. Something about it being counted when going backward or not counted.
You have the calisworkday() to to see if first of the following month is a workday, using year, month + 1, 1, and probably for best results noon.
so if(
calisworkday("first of the following month"),
workday("first of the following month" minus 5),
workday("first of the following month" minus 4)
)
Let me know how that goes