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:eek:ffice:eek:ffice" /><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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

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