Hi there,
I am using a formula to establish future dates (Scheduled Pull-Out Date) based on a starting date (Packaging Date) and adding a number of months according to the 'Time Point' column. The formula seems to work fine until I noticed that two entries (in purple) are not following the rule; they are supposed to add 9 months to the packaging date but the future date is overrun by more than a year. I had to implement IFERROR modifier as sometimes the future dates would not switch to the next year or return an error.
Formula as below (apologies for the block of text):
=IFERROR(IF([TIME POINT]@row = "T0", [PACKAGING DATE]@row , IF([TIME POINT]@row = "3M", DATE(YEAR([PACKAGING DATE]@row ), MONTH([PACKAGING DATE]@row ) + 3, DAY([PACKAGING DATE]@row )), IF([TIME POINT]@row = "6M", DATE(YEAR([PACKAGING DATE]@row ), MONTH([PACKAGING DATE]@row ) + 6, DAY([PACKAGING DATE]@row )), IF([TIME POINT]@row = "9M", DATE(YEAR([PACKAGING DATE]@row ), MONTH([PACKAGING DATE]@row ) + 9, DAY([PACKAGING DATE]@row )), IF([TIME POINT]@row = "12M", DATE(YEAR([PACKAGING DATE]@row ) + 1, MONTH([PACKAGING DATE]@row ), DAY([PACKAGING DATE]@row )), ""))))), IF([TIME POINT]@row = "T0", [PACKAGING DATE]@row , IF([TIME POINT]@row = "3M", DATE(YEAR([PACKAGING DATE]@row ) + 1, 2, DAY([PACKAGING DATE]@row )), IF([TIME POINT]@row = "6M", DATE(YEAR([PACKAGING DATE]@row ) + 1, 5, DAY([PACKAGING DATE]@row )), IF([TIME POINT]@row = "9M", DATE(YEAR([PACKAGING DATE]@row ) + 1, 8, DAY([PACKAGING DATE]@row )), IF([TIME POINT]@row = "12M", DATE(YEAR([PACKAGING DATE]@row ) + 1, MONTH([PACKAGING DATE]@row ), DAY([PACKAGING DATE]@row )), ""))))))
The formula seems to work with other dates for 9M. In addition, if there are any suggestions on how the formula syntax can be shortened, it would be appreciated.
Thanks and regards,
Justin