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

excel 97 time functions

Status
Not open for further replies.

aperture

Programmer
Jul 25, 2001
22
US
hello all-

i am trying to subtract one date/time column (D) in format #mm/dd/yy hh:mm# from another(E) in the same format, to get a result in format #hh:mm#. since these values are for business time based on workdays, i have written a basic formula to obtain serial number values for the caluculated results, which looks like this:

=IF(HOUR(E2-D2)>15,(HOUR(E2-D2)-15),(E2-D2))

my question is: is there a function which will convert serial values BACK into #hh:mm#?

if anyone knows of a better way to do this, i'm interested.

thanks!

aperture
 
As 15 hours = .625 (15/24) days you could use

=(IF(E2-D2>0.625,(E2-D2-0.625),(E2-D2))),

which should give teh same result.

Dates and time are just serial numbers (24 hours (1 day) = 1), so you just need to apply the correct format to your result. The format in this case is probably hh:mm, or perhaps [hh]:mm.

A.C.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top