View Single Post
 
Old 10-23-2018, 11:46 AM
DanOnline DanOnline is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2018
Posts: 7
DanOnline is on a distinguished road
Default Adding 9 months to month end date.

Hello all,

My problem is relatively simple on paper. I have a word template that is populated by mail merge collected from a database, one of these fields generates a date. I need to add 9 months to this date. The date will always be the last date of that month.

I have looked around on the internet and what not and seen Macropods workings of how to add a number of days to a field, but the number of days in a 9 month period will vary. Is there an alternate way in which I could generate this field.

My experience with mail merge is quite limited as I don't use it with any great frequency. But when I looked at prior threads relating to adding day amounts it seemed rather complex. Instead, my mind gravitated towards a solution that took advantage of the fact that I would only have 12 possibilities per a year, 31 Jan, 28 Feb so on and so forth. (discounting leap year) would it be possible to use an IF function that takes advantage of the fact that there are only 12 possible inputs, and 12 outputs per a year to simply match them together? I.e. 31 January becomes 31 October.

{ IF {DATABASEDATE} = "31 January" "31 October" "" }

where DATABASEDATE is a substitute for the field that populates from the database with the date.

However, the mailmerge uses a single field which I guess would create issues due to the year being contained within, the use of an if formula would require a replication would it not. As the field 31 Jan 2017 would be read differently to 31 Jan 2018 and so on. Would be at most 24 combinations as the dates are from now onwards, and the template could be updated every few months as needed. Presumably, the more formulas included greater the period between each change.

Is there an alternative way of doing this? Would the IF formula approach work?
Reply With Quote