3 Replies Latest reply on Jul 22, 2013 7:34 PM by LaRetta_1

# Calculating 20th of the Month deadlines in the future

### Title

Calculating 20th of the Month deadlines in the future

### Post

I have an expiration date field and then I have two target submission date fields.  The target 60-day submission date field should calculate 60-days from the expiration date and it should calculate the 20th of that target month and if that 20th falls on a weekend it should calculate the Friday prior.  The other fieldar will target 90-day submission date field should calculate 90-days from the expiration date and it should calculate the 20th of that target month and if that 20th falls on a weekend it should calculate the Friday prior.

Thanks.

• ###### 1. Re: Calculating 20th of the Month deadlines in the future

Hi Erika,

You might try this (example for two months)  ... just change the +2 to +3 for 90 days ...

Let ( [
d = ExpirationDate ;
r = Date ( Month ( d ) + 2 ; 20 ; Year ( d ) )
] ;
r - Position ( "71" ; DayOfWeek ( r ) ; 1 ; 1 )
)

... corrected typo
• ###### 2. Re: Calculating 20th of the Month deadlines in the future

Thanks LaRetta for the additional comment.  I realized now that I also need for the date to recalculate if the 20th of the month falls on the weekend that it calculate to the Friday before. I had previously used this

date- Middle ("2000001"; Mod (Expiration Date - Date (1;3;1904);7)+1;1)

How can apply this formula to the one you provided?  Thanks again

• ###### 3. Re: Calculating 20th of the Month deadlines in the future

Well, my calc does that, Erika.  The portion with Position() subtracts 1 day if the DayOfWeek is Saturday (7) and 2 days if Sunday (1).