+ Reply to Thread
Results 1 to 11 of 11

Convert Text to Time (not as simple as it sounds)

  1. #1
    Registered User
    Join Date
    02-05-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    365
    Posts
    87

    Convert Text to Time (not as simple as it sounds)

    I've googled converting text to time, and for simple bits I have answers.. what I'm struggling to find is if it's possible to convert something like 8:00am-4:30pm (in one cell) to a Start and End time (two separate cells)



    I'm working with something similar to this sample data...

    Please Login or Register  to view this content.

    Converted start and end times would go into a new sheet with the data underneath each row (as in, 2 rows inserted under each analyst, start time, and then end time.)
    Let me know if I can provide anything else here.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,281

    Re: Convert Text to Time (not as simple as it sounds)

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-05-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    365
    Posts
    87

    Re: Convert Text to Time (not as simple as it sounds)

    Of course, my apologies, I think that's it attached.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,281

    Re: Convert Text to Time (not as simple as it sounds)

    In the meantime, a PowerQuery solution.

    M Code:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,851

    Re: Convert Text to Time (not as simple as it sounds)

    Using Power Query/Get and Transform, you can convert in several steps. Here is a video tutorial on how to do that.

    https://www.youtube.com/watch?v=JMOnr3DOqyk
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    490

    Re: Convert Text to Time (not as simple as it sounds)

    Text to columns with the dash, put a space before am/pm with substitute() and add zero.
    That should do.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,281

    Re: Convert Text to Time (not as simple as it sounds)

    Text to columns is fine if it's a on-off, but it's not really a long-term solution. It will depend on the OP's circumstances.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,281

    Re: Convert Text to Time (not as simple as it sounds)

    You've viewed our suggestions - some feedback would be appreciated.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  9. #9
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Convert Text to Time (not as simple as it sounds)

    In B16 and drag to the right:
    =TEXT((LEFT(B15,SEARCH("-",B15,1)-1)),"hh:mm:ss")

    In B17 and drag to the right:
    =TEXT((RIGHT(B15,SEARCH("-",B15,1)-1)),"hh:mm:ss")


    * Forgot to tell you I replaced with CNTRL+F all "pm" to " PM" (space+PM),
    and same for the "am" --> CTRL F--->Replace---> find what: "am"; replace with " AM" (with a space before AM)
    Attached Files Attached Files
    Last edited by Limor_OP; 06-20-2020 at 07:57 AM.

  10. #10
    Registered User
    Join Date
    02-05-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    365
    Posts
    87

    Re: Convert Text to Time (not as simple as it sounds)

    thank you all for your help and suggestions with this, I'm afraid the project evolved and I never got a chance to test/implement any of these, but I'm so very grateful for the time taken to provide assistance.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,281

    Re: Convert Text to Time (not as simple as it sounds)

    You may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Cannot insert new worksheets.....sounds simple???
    By Victorthesecond in forum Excel General
    Replies: 4
    Last Post: 11-06-2018, 10:49 AM
  2. Formula that shows value between multiple number range.
    By HarrBarr in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-22-2015, 04:29 AM
  3. [SOLVED] How to find two values in one column (sounds so simple..)
    By FlorisL in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2014, 04:04 PM
  4. Time stored as text. How can I convert to data and time?
    By matthewbutterworth in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-07-2013, 10:19 AM
  5. Replies: 3
    Last Post: 03-02-2012, 08:18 PM
  6. [SOLVED] enter time in simple text and convert to hours/minutes
    By YanYan in forum Excel General
    Replies: 5
    Last Post: 06-22-2006, 10:10 PM
  7. [SOLVED] convert time imported as text to time format for calculations
    By batfish in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-27-2005, 07:05 PM

Tags for this Thread

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