# EasyMorph Server - Schedule Last Weekday of the Month

Hi - I’m not sure this is currently possible based on what I’m seeing. But is it possible to set a schedule on EM Server to run a project on the first/last weekday of the month?

If the options available in the Monthly schedule don’t suit you exactly, you can add a condition in your workflow that skips the rest of the workflow on specific days. For instance, you can schedule your workflow to run every Friday, but add a condition in the workflow to skip all Fridays that are not the last in the current month.

To learn about conditional branching, see the tutorial article Conditional workflows.

What I’m still struggling to figure out is how to determine if the current date is the last Friday - or the last weekday of the month?

You can use a condition that checks that
a) the current day is Friday
b) there are less than 7 days from the current day until the end of the month (otherwise, there is a later Friday)

``````IF weekday({Date})=6 AND monthend({Date}) - {Date} < 7 THEN "Yes" ELSE "NO"
``````

See example below.
last-friday.morph (1.8 KB)

I was just getting to this math for the last Friday…but now I’m being asked to do it on the last weekday of the month. I can do this in Excel (determine the last weekday) but I can’t seem to figure out the formula in EasyMorph.

In Excel I’d do =WORKDAY(EOMONTH(TODAY(),0)+1,-1)

Here is my variant:

``````LET weekday = weekday({Date})
IF weekday != 1 and weekday !=7 and workdays({Date},monthend({Date})) = 1 THEN "Yes" ELSE "NO"
``````

Updated example:
last-workday.morph (3.8 KB)