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.
SergeiBaklan
May 28, 2020Diamond Contributor
Small comment - that gives incorrect result for every 100, but not every 400 year. For example year 2100 is not leap.
Riny_van_Eekelen
May 28, 2020Platinum Contributor
SergeiBaklan Hmmmm... you are right. Learned something again.