Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Duration Function - Excel 1

Status
Not open for further replies.
Jan 26, 2004
18
US
Hello all and thanks for reading my post.

In the past I have used the DATEDIF function in excel to determine the delta of two dates. This delta is always one day less than the actual duration. This makes sense because a difference is not the same a duration :)

I was wondering if anyone new a function for determining the actual duration between 2 dates, like M$ Project does with schedule dates.

Many thanks!!
10PoundBrown
 
=datedif()+1

Why would you need anything else, unless of course you were looking to ignore weekends/holidays etc, in which case you may want to look at the NETWORKDAYS function. Might be part of the Analysis Toolpak addin though.

Regards
Ken..............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Yes it is

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Hi 10PoundBrown,

Dates in Excel and Project all have implicit times, but they are not the same.[ul][li]If you enter a date in Excel without a time, the time defaults to 00:00:00 (midnight at the start of the day)[/li][li]If you enter a Start Date for a Task in Project, the time defaults to the start of the working day (perhaps 08:00:00, but configurable)[/li][li]If you enter an End Date for a Task in Project, the time defaults to the end of the working day (perhaps 18:00:00 but, again, configurable)[/li][/ul]Date difference calculations (in both Excel and Project) all use the time and, in one further slight twist, Project considers the end of one working day and the start of the next to be coincident.

So it really depends what you want to do, if DATEDIF + 1 works for you, stick with it; there is no easier way.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Thanks to all, basically, if a start date is the 1st and the end date is the 10th (and for the sake of simplicity, lets assume that we are working 7 days a week) then the duration is 10 days because we work on the first but when I used the datedif function, it returns a value of 9.

Thats my beef with excel right now. Im an excel n00b and I dont know how to automatically add a 1 to the function.

Thanks for your help.
 
Ken has already provided the answer
=datediff(yadda yadda) + 1

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Hi 10PoundBrown,

A couple of ways. Instead of ..

=DATEDIF(A1,B1,"d")

.. you can use ..

=DATEDIF(A1,B1,"d")+1

.. but this will default to a date format which won't be what you want, so it might be better to use ..

=DATEDIF(A1,B1+1,"d")

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
TONY YOU ROCK!!! Thanks to all who helped me, you have made my morning that much better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top