Forum Discussion
EExmannhotmailcom
May 23, 2020Copper Contributor
Leap Year
Finaly got a working routine in Excel VBA to calculate if current or specific date is in a leap year. Please send me a note and I will publish the VBA code in English. kind regards, Eddy
- May 27, 2020
Just in case, with formula you may check as
=IF(MONTH(DATE(YEAR(A1),2,29))=2,"leap", "not leap") or =IF(DAY(DATE(YEAR(A1),3,0))=29,"leap", "not leap") or likeif the date is in A1.
Mike_Blinn
Jul 28, 2020Copper Contributor
TheAntony
Jul 28, 2020Iron Contributor
Mike_Blinn , If you only have the year, just remove the Year function in SergeiBaklan 's formulas:
=IF(MONTH(DATE(A1,2,29))=2,"leap", "not leap")=IF(DAY(DATE(A1,3,0))=29,"leap", "not leap")
Love the simplicity and elegance of the formulas, SergeiBaklan !
- Mike_BlinnJul 29, 2020Copper Contributor
Thanks you TheAntony !!