There’s potentially even more to consider than just what should happen if there are fewer days in the following month. Like what should happen with repeated increments:
March 31st + 1 month → April 30th
April 30th + 1 month → May 30th ? or should it ‘rebound’ back to May 31st, given that it is conceptually ‘the last day of the month’?
Eventually I reached the conclusion that the easiest thing to do may just be to round down all calculated dates to the 28th of the month. For the first occurrence, the calculated value may be ‘wrong’, but after that, it all settles down.
Alternatively, why not just add 30 days, and acknowledge that the day of the month will gradually creep down.
Or perhaps it makes sense to pick a working day, in which case, add 30 days, and then move to the next available working day.
This will quickly settle down to a pattern of Monday, Wednesday, Friday, Monday, Wednesday, Friday, … and after 12 monthly increments, you will have added 364 days. For a lot of people, this is good enough.
TLDR: there are some nice solutions that don’t require too many if…thens.
Otherwise, the nicest formula is something like this:
Date(
If((Month([Date value]) + [Month increment]) > 12,
Year([Date value]) + 1,
Year([Date value])),
If((Month([Date value]) + [Month increment]) > 12,
(Month([Date value]) + [Month increment]) - 12,
Month([Date value]) + [Month increment]),
Least(
Day([Date value]),
Day(Date(
If((Month([Date value]) + [Month increment]) > 11,
Year([Date value]) + 1,
Year([Date value])),
If((Month([Date value]) + [Month increment]) > 11,
(Month([Date value]) + [Month increment]) - 11,
(Month([Date value]) + [Month increment]) + 1),
1)
- Days(1)
)
)
)
I hope you can figure out what it’s doing