View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default Time milliseconds format

In A1, I entered this text: 01:20:45:45
And in B1 I used =TIME(LEFT(A1,2),MID(A1,4,2),MID(A1,7,2)+RIGHT(A1, 2)/100)
Not withstanding the fact that a Goggle search gave lots of recommendations
to use a custom format of h:mm:ss.000, I was unable to get a working format
to display 1:20:45.450

Here is my workaround. Text in column A, formulas in B and C
01:20:45:48 1:20:45 0.480
02:04:05 2:04:05 0.000
02:06:05:55 2:06:05 0.550


B1:=TIME(LEFT(A1,2),MID(A1,4,2),MID(A1,7,2))
C1:=IF(LEN(A1)8,RIGHT(A1,2)/100,0)

Sum to nearest second with: =SUM(B1:B3)+SUM(C1:C3)/(24*60*60)
Get the milliseconds with: =MOD(SUM(C1:C3),1)

Hope this helps
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Kaykayme" wrote in message
...
I have a spreadsheet with data gathered from an HTML file. The time field
shows the usage in elasped time. Some of the data has the standard
elapsed
time format "13:36:17" and some show the elapsed time with milliseconds
"37:10:46:54". I have tried changing the number format to the standard
elapsed time format with a decimal to show milliseconds but not all
converted
because the field uses AM and PM at the end. I tried copying the text of
each cell to another cell then converting but the form is not consistent.
Is
there anyway to programatically convert this elasped time field to a
consistent number format so that each users usage can be subtotaled?