Archive of Mr Excel Message Board


Back to Forms in Excel VBA archive index
Back to archive home

Time Conversion

Posted by Alex Nolan on July 31, 2001 4:18 PM
If you have a time format, ie hh:mm:ss such as 10:14:12
how can you convert this so it is all in seconds? ie:
36852 seconds.

I know I can do this with the hrs, mins, secs in separate columns but to do it from one input would be nice.

Thanks


Re: Time Conversion

Posted by Ian on July 31, 2001 4:53 PM


if 10:14:12 is in cel A1 then in B2 put =A1*86400
format cell to general

hope this helps

Ian


Re: Time Conversion

Posted by Mark W. on August 01, 2001 8:13 AM
In case you're wondering where Ian came up with
86400. Remember that Excel stores times as
a fractional part of a day (e.g., 12:00 is 0.5).
So to convert a fraction of a day to seconds
you multiply it by...

24 {hr/day} * 60 {min/hr) * 60 {sec/min}

...or 86400


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.