DATEDIF - trouble with February - Excel 07

RB1645

New Member
Joined
Oct 9, 2013
Messages
4
Hi

Having a spot of bother with DATEDIF. I'm trying to count the number of full months between two given dates. DATEDIF was doing just fine until I got to February.

I'm using =DATEDIF(Start Date,End Date,"m") and getting the following ...

Start Date
End Date
DATEDIF result
31/12/2012
31/1/2013
1
31/1/2013
28/2/2013
0
28/2/2013
30/3/2013
1

<TBODY>
</TBODY>

Adding a +1 adjustment on any February entries isn't really going to work - as I have a lot of data and this would be asking for trouble later when the tool I'm building is 'released into the wild'.

Any help greatly appreciated.

Thanks very much.

-----

Even better would be a way to count full named months between two dates rather than the DATEDIF method above.

By "full named months" I mean the entirety of a month from first day to last - e.g., January, 1st to 31st inclusive; February 1st to 28th/29th inclusive; etc.

If I wanted to know the number of full months, as defined above, between 15/12/2012 and 31/1/2013 I would want the answer to be 1 (i.e., all of January falls in the specified period). Whereas between 15/12/2012 and 16/1/2013 I'd want 0 (i.e., there are only parts of full named months in the period).
 

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 for that Andrew - I had seen that thread, but not realised there were multiple pages to it - every day's a school day.

It seems it's a problem taxing bigger Excel brains than mine.

It's a shame HR Managers don't write sick leave tracking policies that respect the date calcs that Excel can cope with (or vice versa)! Life would be so much easier.
 
Upvote 0

Forum statistics

Threads
1,216,115
Messages
6,128,919
Members
449,478
Latest member
Davenil

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