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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Elapsed Time 5

Status
Not open for further replies.

coder1964

IS-IT--Management
Aug 28, 2003
29
0
0
CA
Hi

Excel

I have been struggling with a formula to display elapsed time since the start of a project.

What I want is subtract todays date from a start date and nothing I try seems to work.

In one cell i have the startdate and in another =now().

 
Have a look at my FAQ: faq68-4037 What are some of Excel's date functions?

It will definately help!

;-)


Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
or - if you just want days, try
=(Now()-A1)/24
and format as [hh]
this will actually give you the number of days

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
 
Many thanks guys. Will give those suggestions a try and let you know how I get on.
 
or =DATEDIF(A1;TODAY();"d")

with no need to format. ;-)

Have a look at the BOTTOM of my FAQ: FAQ68-4037


Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
sorry Mike - didn't want to jump in but I had the idea about using [hh] as days and it worked so I thought I'd post it

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
 
Geoff,

I wasn't biting you head off or anything, actually the [hh] bit is kinda cool. I never would've though about it.

This [cheers] 's for you!



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Many thanks all.

With your help I got it to work.
 
Mike - I think it'd work for weeks as well - just divide by 168 instead of 24

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
 
Genius Geoff!!! Pure and Simple!!!
star.gif
for you!!!

But this can also be done w/o having to format the cell (i.e. it can be left at "General"):

To get the number of days

=VALUE(TEXT((NOW()-$A$1)/24,"[h]"))

To get the number of weeks

=VALUE(TEXT((NOW()-$A$1)/168,"[h]"))

Plus this can also be taken further to get the exact number of days (w/ decimal) by using "[h].m" format!

To get the exact number of days (w/ hours as a decimal)

=VALUE(TEXT((NOW()-$A$1)/24,"[h].m"))

To get the exact number of weeks (w/ days as a decimal)

=VALUE(TEXT((NOW()-$A$1)/168,"[h].m"))

This works with days and weeks because 1 day = 24 hours and 1 week = 168 hours. Unfortunately the months have various number of days and there is a leap year. But I'm sure that with a couple of nested if's you could get it to work for months and years too!!

I think I will add this to my FAQ: faq68-4037 - What are some of Excel's date functions?



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Don't wanna get done for back scratching but have a star for the extrapolation of the idea and yes, please do add it to your FAQ

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
 
FAQ has been updated!!



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
XLBO... a star for you because I can't give you one on the FAQ that Mike (Bowers74) updated....

He suggested I come here to star you since this is where it started... so consider yourself starred! :)

Have a great weekend folks...


LadyCK3
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top