+ Reply to Thread
Results 1 to 8 of 8

convert text to time

  1. #1
    Registered User
    Join Date
    04-03-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    convert text to time

    Hi, I wonder if someone could help me please, I have a column which has 24 hour time listed as follows:


    ConsumptionPeriod
    0
    30
    100
    130
    200
    230
    300
    330
    400
    430
    500

    the 0 representing 0:00 and so on

    I need the column to be populated with actual 24 times in half hourly increments
    does anyone know of a quick way to do this please?

    thanks for your help

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: convert text to time

    Hi victoria,

    welcome to the forum.

    quick way: - type 1440 anywhere in the worksheet, copy it, select the data, paste special +values+divide, Enter
    change the data format to hh:mm:ss and it's DONE

    regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    04-03-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: convert text to time

    Quote Originally Posted by dilipandey View Post
    Hi victoria,

    welcome to the forum.

    quick way: - type 1440 anywhere in the worksheet, copy it, select the data, paste special +values+divide, Enter
    change the data format to hh:mm:ss and it's DONE

    regards,
    DILIPandey

    <click on below 'star' if this helps>
    Thanks DILIPandey for responding so quickly, I tried what you said however this happens:


    00:00:00
    00:30:00
    01:40:00
    02:10:00
    03:20:00
    03:50:00
    05:00:00
    05:30:00
    06:40:00
    07:10:00
    08:20:00

    as you can see the times are not in half hour increments, can you help again, thanks

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: convert text to time

    Ok.. victoria..

    Please share the example as to how data will look like if we transfer them in half hour increment... thanks.

    regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    03-26-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: convert text to time

    Try this:

    =IF(LEN(A1)=1,"0:00",IF(LEN(A1)=2,"0:"&A1,SUBSTITUTE(A1,RIGHT(A1,2),":"&RIGHT(A1,2))))

    You will then have to swap it from general to time format but it should work.

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: convert text to time

    Or maybe
    Please Login or Register  to view this content.
    Format Cells > Number format > Custom Type:= hh:mm
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  7. #7
    Registered User
    Join Date
    04-03-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: convert text to time

    Quote Originally Posted by Marcol View Post
    Or maybe
    Please Login or Register  to view this content.
    Format Cells > Number format > Custom Type:= hh:mm
    thanks for your help

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: convert text to time

    Quote Originally Posted by victoria74 View Post
    Thanks DILIPandey for responding so quickly, I tried what you said however this happens:


    00:00:00
    00:30:00
    01:40:00
    02:10:00
    03:20:00
    03:50:00
    05:00:00
    05:30:00
    06:40:00
    07:10:00
    08:20:00

    as you can see the times are not in half hour increments, can you help again, thanks
    Dividing the numbers by 1440 because there are 1440 minutes in a day.
    The works for the first 2 times because you are really dividing minutes..
    After that the numbers are not minutes.
    100 is really 60 minutes. 100/1440 will not give you the correct answer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1