DATEDIF fuction in XL03 on WindowsXP - How to count Inclusive of start and end dates?

Mike Bravo

New Member
Joined
Apr 8, 2008
Messages
2
Hoping someone can help me out. I work in employment services, and we often need to figure out how long a client spent working with a certain employer, in terms of how many days. We need to figure out the total time they’ve spent working, despite the gaps between employment periods.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I knocked up a spreadsheet using the datedif function, letting me put in two dates (the date they started and finished with a certain employer), to give me an answer.<o:p></o:p>
I was told by my manager that it was great, but was always one day short.<o:p></o:p>
<o:p></o:p>
For our purposes, we must count inclusive of the start and end dates - I can't get excel to do this. Eg. it will count 1/5/08 to 1/5/08 as 0 days.<o:p></o:p>
<o:p></o:p>
Our guidelines would count the same period (1/5/08 to 1/5/08) as 1 day.
<o:p></o:p>
My question: Is there a way I can make it count inclusively, as above (1 day not 0 days)?<o:p></o:p>
<o:p></o:p>
Here's my formula, using A5 and B5 as my Start and End dates:<o:p></o:p>
=DATEDIF(A5,B5,"y") & " years, " & DATEDIF(A5,B5,"ym") & " months, " & DATEDIF(A5,B5,"md") & " days"<o:p></o:p>
<o:p></o:p>
I also have on the same sheet one counting in just days:<o:p></o:p>
=DATEDIF(A5,B5,"d") & " days"<o:p></o:p>
<o:p></o:p>
Hope someone can help, thanks in advance.<o:p></o:p>
<o:p></o:p>
~ MB.<o:p></o:p>
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Code:
=DATEDIF(A5,B5,"y") & " years, " & DATEDIF(A5,B5,"ym") & " months, " & DATEDIF(A5,B5,"md")+1 & " days"

=DATEDIF(A5,B5,"d")+1 & " days"

Should ensure the inclusive day - I tested a variety and it seems to work fine.

Cheers,
WageSlave
 
Upvote 0

Forum statistics

Threads
1,223,983
Messages
6,175,779
Members
452,668
Latest member
mrider123

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