3 Replies Latest reply on Feb 14, 2013 2:49 PM by TimothyNees

# Looking for a way to calculate the last Monday of any Month

### Title

Looking for a way to calculate the last Monday of any Month

### Post

I have a short DB which reminds users to maintain there equipment at specific intervals, Daily is easy enough, Weekly is also easy.  Monthly, not so easy.  They want to be reminded the last Monday of every Month, and I haven't found a reliable calculation for this yet.  I'm sure someone out there must have done this already, your help is appreciated.

• ###### 1. Re: Looking for a way to calculate the last Monday of any Month

There may be an easier formula but this is the one I came up with.   Requires 2 Calculation fields and a Date field.

days and LastMondayMonth.

days calculation

DayOfWeek(Date (Month (CurrentMonth) + 1; 0; Year (CurrentMonth)))-2

LastMondayMonth Calculation

Case(days ≥ 2;Date (Month (CurrentMonth) + 1; 0; Year (CurrentMonth))-
(DayOfWeek(Date (Month (CurrentMonth) + 1; 0; Year (CurrentMonth)))-2);
days<0;Date (Month (CurrentMonth) + 1; 0; Year (CurrentMonth))-6;
days=0;Date (Month (CurrentMonth) + 1; 0; Year (CurrentMonth));
days=1;Date (Month (CurrentMonth) + 1; 0; Year (CurrentMonth))-1
)

• ###### 2. Re: Looking for a way to calculate the last Monday of any Month

Let ( [ Dt = YourDateFieldHere ;
DtLast = Date ( Month ( Dt ) + 1 ; 0 ; Year ( Dt ) ) ]; // this is the date for the last day of the same month
DtLast - Choose ( DayOfWeek ( DtLast ) ; 0 ; 6 ; 0 ; 1 ; 2 ; 3 ; 4 ; 5 )
)

• ###### 3. Re: Looking for a way to calculate the last Monday of any Month

Thanks for the equations I will attempt to apply them.