Forum Discussion
lperry40
Feb 23, 2021Copper Contributor
Excel Leap year formula
I have a vacation spreadsheet and I have come across a glitch that has to do with leap year, I need to add a leap year formula to an existing formula so it can calculate my vacation correctly becaus...
SergeiBaklan
Feb 26, 2021Diamond Contributor
The basis of check could be the fact if DAY() for 29th of Feb returns 29 or 1, like
=IF(DAY(DATE(2021,2,29))=1, "not leap", "leap")
lperry40
Feb 26, 2021Copper Contributor
so how do I incorporate it into my existing formula? because this is the cell that the days start to go wrong (see below) and the longer the person is employed (for example this gentleman has been at our company for 30 years and he is about 5 to 6 days off because of the leap years.)
=(DATEDIF(D168,E168,"d")/365 |
=(DATEDIF(D168,E168,"d")/365 ???? my guess is |
=(DATEDIF(D168,E168,"d")/365)*(IF(DAY(DATE(2021,2,29))=1
|