# Thread: Calculating month of years using n month delay

1. ## Calculating month of years using n month delay

Hello,

I'm trying to figure out why I have to set my delay out an extra 12 months to get the desired delay results. If i set it out an extra 12 month its accurate for 11 out of 12 months.

I'm attempting to take a date out 1 month behind 10 years or 119 months.

If I take Decemeber 2013 and set the delay to 131 months my result is November 2023.

If I take January 2014 and add 131 month I get Decemeber 2024 instead of it being Decemeber 2023.

{QUOTE
{SET DELAY 10}
{SET m{=MOD({Mergefield\@MM}+Delay+11,12)+1}}
{SET y{=INT({Mergefield\@ yyyy}+(Delay+{Mergefield\@ M}-1)/12}}
"{m}-{y}" \@ "MMMM yyyy"}

Thank you

2. Did you look at and use the fields at the Date Field Calculation Tutorial?

If you started from one of those fields, which one?

3. I took the formula off page 9 under:

Calculate a month and year, using n months delay

4. Originally Posted by Gargo
If I take Decemeber 2013 and set the delay to 131 months my result is November 2023.

If I take January 2014 and add 131 month I get Decemeber 2024 instead of it being Decemeber 2023.
Without wanting to place too fine appoint on it:
1 December 2013 + 131 months = 1 November 2024!
1 January 2014 + 131 months = 1 December 2024!
and that's what the field code returns in both cases...

5. ## The Following User Says Thank You to macropod For This Useful Post:

Gargo (2014-03-20)

6. I missed that @ and it was causing the 13 month delay. Thank you for your resources and response. Much appreciated!

{QUOTE
{SET DELAY 10}
{SET m{=MOD({Mergefield\@MM}+Delay+11,12)+1}}
{SET y{=INT({Mergefield\@ yyyy}+(Delay+{Mergefield\@ M}-1)/12}}
"{m}-{y}" \@ "MMMM yyyy"}

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•