DATEDIF results

Paella1

Active Member
Joined
Mar 10, 2005
Messages
382
I would have thought the result to:

=DATEDIF("30/5/2009","30/6/2009","md")

... would be 1, given that there is 1 month and 1 day between these dates.

But the formula returns zero. Am I missing something? If not, can anyone suggest a workaround?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Thanks sanrv1f, but I am interested in the day that seems to have gone missing, not the number of months.
 
Upvote 0
... given that there is 1 month and 1 day between these dates.
How do you figure that?

Dates are notoriously tricky, but I would have thought it quite a reasonable interpretation that one month after 30 May is 30 June
 
Upvote 0
Spot on, Peter. DATEDIF uses the number of days in the first month as it's definition of a month. Hence DATEDIF will report that there is 1 month & 3 days between 28 Feb and 31 Mar, whereas if DATEDIF used the number of days in the second month, this would be 1 month exactly. I think I now understand why Microsoft doesn't like to talk abou DATEDIF.

Thanks for your help.
 
Upvote 0
I am using this formula
Code:
=DATEDIF(TODAY(),EDATE($B$19,12*(DATEDIF($B$19,TODAY(),"y")+1)),"m")&" Mths "&DATEDIF(TODAY(),EDATE($B$19,12*(DATEDIF($B$19,TODAY(),"y")+1)),"md")&" Days"
for calculating months and days to the next birthday from today. In this B19 is the date of birth for the person in question.
If it helps anybody, I will be happy that I was of some use to some body. :)
 
Upvote 0
DATEDIF uses the number of days in the first month as it's definition of a month.
I think it just reasons that from 'x' day in any month to 'x' day in any other month is a whole number of months, irrespective of the number of days in any of the months.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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