Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default how do i convert data with miliseconds to just h:mm:ss

i have time data with hours, minutes, seconds, and miliseconds. but in order
to do my calculations, i need to drop the miliseconds. how can i format this
data so it will only display h:mm:ss?

example: if a cell reads 12:34:55:789, how do i format the cell so the 789
miliseconds drops off, and cell only shows 12:34:55?

i know this can be done in currency and numbers, as you can indicate how
many decimal places you want. so how do you do it with time?
  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: how do i convert data with miliseconds to just h:mm:ss

To convert time data with milliseconds to just h:mm:ss, you can use the custom time format in Excel. Here are the steps:
  1. Select the cell(s) containing the time data with milliseconds that you want to convert.
  2. Right-click on the selected cell(s) and choose "Format Cells" from the context menu.
  3. In the Format Cells dialog box, select "Custom" from the Category list.
  4. In the Type field, enter the following custom time format: h:mm:ss
  5. Click "OK" to apply the custom time format to the selected cell(s).

Now, the time data with milliseconds will be displayed in the h:mm:ss format, with the milliseconds dropped off. For example, if a cell reads 12:34:55.789, it will be formatted to display as 12:34:55.

Note that this custom time format will only affect the display of the time data in the selected cell(s). The underlying value of the time data will still include the milliseconds, so if you use the time data in calculations, the milliseconds will still be taken into account.
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default how do i convert data with miliseconds to just h:mm:ss

a cell reads 12:34:55:789

Excel doesn't recognize that as time value. To Excel it's a TEXT string. So,
you probably need to use a helper column to convert it to a real time value.

If the format is *always* hh:mm:ss:ms try this:

A1 = 12:34:55:789

=--LEFT(A1,8)

Format in the Time format of your choice.

--
Biff
Microsoft Excel MVP


"bingo983" wrote in message
...
i have time data with hours, minutes, seconds, and miliseconds. but in
order
to do my calculations, i need to drop the miliseconds. how can i format
this
data so it will only display h:mm:ss?

example: if a cell reads 12:34:55:789, how do i format the cell so the 789
miliseconds drops off, and cell only shows 12:34:55?

i know this can be done in currency and numbers, as you can indicate how
many decimal places you want. so how do you do it with time?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default how do i convert data with miliseconds to just h:mm:ss

=LEFT(A1,8) and format that to hh:mm:ss

If this post helps click Yes
---------------
Jacob Skaria


"bingo983" wrote:

i have time data with hours, minutes, seconds, and miliseconds. but in order
to do my calculations, i need to drop the miliseconds. how can i format this
data so it will only display h:mm:ss?

example: if a cell reads 12:34:55:789, how do i format the cell so the 789
miliseconds drops off, and cell only shows 12:34:55?

i know this can be done in currency and numbers, as you can indicate how
many decimal places you want. so how do you do it with time?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default how do i convert data with miliseconds to just h:mm:ss

One more...

=LEFT(J29,FIND(":",J29,8)-1)

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

=LEFT(A1,8) and format that to hh:mm:ss

If this post helps click Yes
---------------
Jacob Skaria


"bingo983" wrote:

i have time data with hours, minutes, seconds, and miliseconds. but in order
to do my calculations, i need to drop the miliseconds. how can i format this
data so it will only display h:mm:ss?

example: if a cell reads 12:34:55:789, how do i format the cell so the 789
miliseconds drops off, and cell only shows 12:34:55?

i know this can be done in currency and numbers, as you can indicate how
many decimal places you want. so how do you do it with time?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default how do i convert data with miliseconds to just h:mm:ss

And, yet, one more...

=--REPLACE(A1,9,4,"")

By the way, I think you should include the double unary in front of the
string functions you posted in order to convert them to real time values
(which can then be formatted as a Time value); although, to be fair to you,
the OP's posting can be read that a text value should be returned (I just
don't think that is what is he actually wants).

--
Rick (MVP - Excel)


"Jacob Skaria" wrote in message
...
One more...

=LEFT(J29,FIND(":",J29,8)-1)

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

=LEFT(A1,8) and format that to hh:mm:ss

If this post helps click Yes
---------------
Jacob Skaria


"bingo983" wrote:

i have time data with hours, minutes, seconds, and miliseconds. but in
order
to do my calculations, i need to drop the miliseconds. how can i format
this
data so it will only display h:mm:ss?

example: if a cell reads 12:34:55:789, how do i format the cell so the
789
miliseconds drops off, and cell only shows 12:34:55?

i know this can be done in currency and numbers, as you can indicate
how
many decimal places you want. so how do you do it with time?


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default how do i convert data with miliseconds to just h:mm:ss

"bingo983" wrote:
i have time data with hours, minutes, seconds, and miliseconds. but in
order
to do my calculations, i need to drop the miliseconds. how can i format
this
data so it will only display h:mm:ss?
example: if a cell reads 12:34:55:789


It might be easier (and better) if you entered such time in a format that
Excel (but not VBA) supports, namely the custom format h:mm:ss.000 .

Then you could do your calculations directly (e.g. =A1+A2), without having
to "drop" the milliseconds. Just remember to propagate the custom format to
all cells involved in the calculation.

(Caveat: the direct calculation is subject to numerical abberations that
beset all computations involving decimal fractions. But that is true of the
h:mm:ss format as well.)

If you are interested in "dropping" milliseconds anyway, first you need to
decide if you want to truncate or round milliseconds.

To round, you could do:

=text(A1,"h:mm:ss") + text(A2,"h:mm:ss")

To truncate, you could do:

=(TEXT(A1,"h:mm")&LEFT(TEXT(A1,":ss.000"),3))
+ (TEXT(A2,"h:mm")&LEFT(TEXT(A2,":ss.000"),3))

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default how do i convert data with miliseconds to just h:mm:ss


bingo983;294786 Wrote:
i have time data with hours, minutes, seconds, and miliseconds. but in
order
to do my calculations, i need to drop the miliseconds. how can i format
this
data so it will only display h:mm:ss?

example: if a cell reads 12:34:55:789, how do i format the cell so the
789
miliseconds drops off, and cell only shows 12:34:55?

i know this can be done in currency and numbers, as you can indicate
how
many decimal places you want. so how do you do it with time?


Hello,
would following formula help ?
=LEFT(A1;LEN(A1)-4)*1 formatted as h:mm:ss


--
Pecoflyer

Cheers -
*'Membership is free' (http://www.thecodecage.com)* & allows file
upload -faster and better answers

*Adding your XL version* to your post helps finding solution faster
------------------------------------------------------------------------
Pecoflyer's Profile: http://www.thecodecage.com/forumz/member.php?userid=14
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=82401

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert monthly data into quarterly data? jetlag Excel Discussion (Misc queries) 3 April 2nd 23 08:54 PM
how do i convert vertical data into horizontal data Rod Dakan Excel Discussion (Misc queries) 6 February 27th 08 05:59 PM
I want to convert word column data to excel row data to sort addre craywill Excel Discussion (Misc queries) 0 April 18th 06 07:16 PM
How do I convert monthly data to quarterly data? Moses Excel Discussion (Misc queries) 2 September 7th 05 11:13 PM
can i convert data copied as an image into data in excel ? prabhat Excel Worksheet Functions 1 March 1st 05 12:49 PM


All times are GMT +1. The time now is 06:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"