Forum Discussion
Sue_G
Jul 03, 2019Brass Contributor
Excel End of Month Question
I want to be able to have Excel automatically add a date based on another set of data. For example, we have a production date of 7/3/2019. The shelf life in most cases is 4 years, but there are som...
SergeiBaklan
Jul 04, 2019Diamond Contributor
Twifoo , if only in leap years it's not Feb 28 required
Twifoo
Jul 04, 2019Silver Contributor
Thanks for your astute remark, SergeiBaklan. I wilfully ascribed the expiry date a liberal construction as to mean a day not later than the 30th. Thus, such date may be the 29th of February during leap years.
If a strict construction is to pursued, such that expiry dates in February always occur on the 28th, my formula shall be slightly longer with an addition of another logical test, like this:
=EOMONTH(A2,B2)-
OR(MONTH(A2)=
{1,3,5,7,8,10,12})-
(DAY(EOMONTH(A2,B2))=29)
If a strict construction is to pursued, such that expiry dates in February always occur on the 28th, my formula shall be slightly longer with an addition of another logical test, like this:
=EOMONTH(A2,B2)-
OR(MONTH(A2)=
{1,3,5,7,8,10,12})-
(DAY(EOMONTH(A2,B2))=29)