Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 542
Default time conversion from a varying data dump

I hope this is an easy one...

I have data that spits out times in a text format that usually appear as
:mm:ss (zero hours are omitted), but in the rare chance it goes over 60min,
it appears as h:mm:ss. How do I account for the varying digit(s) for the
hours when using
TIME(hh,mm,ss)? The time starting with the ":" throws a monkeywrench into my
formulas...

I got it to work for anything under an hour using:
TIME(0,RIGHT(LEFT(A1,3),2),RIGHT(A1,2)), but when its greater than 60min, it
doesn't work (obviously since theres a zero in the hour field).
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default time conversion from a varying data dump

You can format the cell using [] around whatever you don't want to roll over
to the next time unit. Example [mm]:ss will cause there never to be hours
shown. It will show 45:45, 59:45, 68:45, 90:45, 100:45, 2013:45 all
representing minutes and seconds and not hours. You are still stuck with the
number of digits however. Although, you could use the find function in your
formula to look for the ":" and adjust you left,right,mid functions based on
that find....

Hope that is a start.

"James" wrote:

I hope this is an easy one...

I have data that spits out times in a text format that usually appear as
:mm:ss (zero hours are omitted), but in the rare chance it goes over 60min,
it appears as h:mm:ss. How do I account for the varying digit(s) for the
hours when using
TIME(hh,mm,ss)? The time starting with the ":" throws a monkeywrench into my
formulas...

I got it to work for anything under an hour using:
TIME(0,RIGHT(LEFT(A1,3),2),RIGHT(A1,2)), but when its greater than 60min, it
doesn't work (obviously since theres a zero in the hour field).

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 542
Default time conversion from a varying data dump

Thats good to know (I wondered what the brackets were for). All I'm really
trying to do is to have a separate column to look at column (data dump) and
convert the text displayed as ":15:37" to equate to a cell formated to time
to display "0:15:37". Additionally if the text comes in as "3:48:12" I want
the same formula to recognize the difference betwen the lack of a zero in the
first example and the addition of a digit in the hours field for the second.
My goal is to use this function:

=TIME( equation for hour, equation for min, equation for sec)

with the use of left mid and right. Unfortunately I'm still grasping the
functionality of left, right and mid, and my coffee hasn't kicked in :) so I
was hoping someone would just tell me the equation to put in there. :P

"William Horton" wrote:

You can format the cell using [] around whatever you don't want to roll over
to the next time unit. Example [mm]:ss will cause there never to be hours
shown. It will show 45:45, 59:45, 68:45, 90:45, 100:45, 2013:45 all
representing minutes and seconds and not hours. You are still stuck with the
number of digits however. Although, you could use the find function in your
formula to look for the ":" and adjust you left,right,mid functions based on
that find....

Hope that is a start.

"James" wrote:

I hope this is an easy one...

I have data that spits out times in a text format that usually appear as
:mm:ss (zero hours are omitted), but in the rare chance it goes over 60min,
it appears as h:mm:ss. How do I account for the varying digit(s) for the
hours when using
TIME(hh,mm,ss)? The time starting with the ":" throws a monkeywrench into my
formulas...

I got it to work for anything under an hour using:
TIME(0,RIGHT(LEFT(A1,3),2),RIGHT(A1,2)), but when its greater than 60min, it
doesn't work (obviously since theres a zero in the hour field).

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default time conversion from a varying data dump

If your input times always have two digits for minutes and for seconds (e.g.
:05:07), you could try:
=IF(ISNUMBER(A1),A1,TIME(IF(LEFT(A1)=":",0,LEFT(A1 ,FIND(":",A1)-1)),MID(A1,FIND(":",A1)+1,2),RIGHT(A1,2)))

If they may be formatted as :5:7 then you'll need some extra complication.
--
David Biddulph

"James" wrote in message
...
Thats good to know (I wondered what the brackets were for). All I'm really
trying to do is to have a separate column to look at column (data dump)
and
convert the text displayed as ":15:37" to equate to a cell formated to
time
to display "0:15:37". Additionally if the text comes in as "3:48:12" I
want
the same formula to recognize the difference betwen the lack of a zero in
the
first example and the addition of a digit in the hours field for the
second.
My goal is to use this function:

=TIME( equation for hour, equation for min, equation for sec)

with the use of left mid and right. Unfortunately I'm still grasping the
functionality of left, right and mid, and my coffee hasn't kicked in :) so
I
was hoping someone would just tell me the equation to put in there. :P

"William Horton" wrote:

You can format the cell using [] around whatever you don't want to roll
over
to the next time unit. Example [mm]:ss will cause there never to be
hours
shown. It will show 45:45, 59:45, 68:45, 90:45, 100:45, 2013:45 all
representing minutes and seconds and not hours. You are still stuck with
the
number of digits however. Although, you could use the find function in
your
formula to look for the ":" and adjust you left,right,mid functions based
on
that find....

Hope that is a start.

"James" wrote:

I hope this is an easy one...

I have data that spits out times in a text format that usually appear
as
:mm:ss (zero hours are omitted), but in the rare chance it goes over
60min,
it appears as h:mm:ss. How do I account for the varying digit(s) for
the
hours when using
TIME(hh,mm,ss)? The time starting with the ":" throws a monkeywrench
into my
formulas...

I got it to work for anything under an hour using:
TIME(0,RIGHT(LEFT(A1,3),2),RIGHT(A1,2)), but when its greater than
60min, it
doesn't work (obviously since theres a zero in the hour field).



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
transposing vertical data to horizontal with varying amount of data Ghosty Excel Discussion (Misc queries) 5 August 1st 06 05:20 AM
extract key words/data from multiple files -dump in new worksheet MikeR-Oz New Users to Excel 10 March 20th 06 08:14 AM
Varying data on X axis coa01gsb Charts and Charting in Excel 2 February 6th 06 02:48 PM
Time conversion SteveTALL Excel Worksheet Functions 2 December 17th 05 07:16 PM
Condensing a large data dump Ant Excel Discussion (Misc queries) 1 October 4th 05 06:30 PM


All times are GMT +1. The time now is 04:07 PM.

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"