Date to Date Including Leap Day

mrivera

New Member
Joined
Aug 18, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am trying to calculate from date to date that includes Leap Day.
In my example the results should be 1 Year, 0 Months and 1 Day.

1/1/2020​
1/1/2021​
1 years, 0 months, 0 days

The formula I have currently is
=DATEDIF(A1,B1,"y")&" years, "&DATEDIF(A1,B1,"ym")&" months, "&B1-DATE(YEAR(B1),MONTH(B1),1)&" days"

Thanks for your help.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
@mrivera Welcome.
What makes you consider it to be incorrect?
Every 4 years, a the leap year will comprise 366 days rather than 365.
 
Upvote 0
That was my thought too.
But my HR department wants to know the Extra days that leap year adds.
They want to know if a person has been here 4 year plus the extra 1 day or 8 years plus 2 days.
I suppose it make a difference to them? I'm just trying to please them.
 
Upvote 0
That was my thought too.
But my HR department wants to know the Extra days that leap year adds.
They want to know if a person has been here 4 year plus the extra 1 day or 8 years plus 2 days.
I suppose it make a difference to them? I'm just trying to please them.
That is faulty logic. If a person is 40 years old, so they have lived through 10 leaps years, on their 40th birthday, you would not say that they are 40 years and 10 days old.
A year is actually more than 365 days. More precisely, it is 365.2422 days (see: Which years are leap years and can you have leap seconds?.).

If, for your HR purposes, they are treated 365 days as the number of days in a year, then just subtract the two days and divide by 365.
I would recommend keeping the answer in decimal form, or do just years and days.
Otherwise, you get into another mess when you try to decide how many days there are in a month (it wouldn't be exactly 30 unless you say there are 360 days in a year).
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top