+ Reply to Thread
Results 1 to 9 of 9

Convert text to hours/minutes/seconds

  1. #1
    Registered User
    Join Date
    11-20-2019
    Location
    London, England
    MS-Off Ver
    16.29.1
    Posts
    12

    Convert text to hours/minutes/seconds

    hi, i need to convert a cell containing text to a time. The output is for the time it has taken to complete a run so needs to be hh:mm:ss rather than a time of day.

    I have attached a file and a sample of the output i'm looking for.

    Thanks in advance for your help.

    Jacob
    Attached Files Attached Files

  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,460

    Re: Convert text to hours/minutes/seconds

    In your output cell:

    =TIME(0,LEFT(D2,2),RIGHT(D2,2))

    Custom format the column as [hh]:mm:ss.
    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
    11-20-2019
    Location
    London, England
    MS-Off Ver
    16.29.1
    Posts
    12

    Re: Convert text to hours/minutes/seconds

    brilliant, thank you so much

  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,460

    Re: Convert text to hours/minutes/seconds

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

    Also, 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.

  5. #5
    Registered User
    Join Date
    11-20-2019
    Location
    London, England
    MS-Off Ver
    16.29.1
    Posts
    12

    Re: Convert text to hours/minutes/seconds

    I've just noticed a different case where the original text value contains an hour field. eg - 3:31:17. I'm guessing this needs a different formula as is not working with the current one.

    Do let me know if i need to open a new thread or if there is a way to reopen this thread as i could not see how.

    Thanks

  6. #6
    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,460

    Re: Convert text to hours/minutes/seconds

    Remove the SOLVED link (reverse of the way you added it!) and provide an updated sample workbook

    You could try this:

    =IF(LEN(D2)<6,TIME(0,LEFT(D2,2),RIGHT(D2,2)),TIME(SUBSTITUTE(LEFT(D2,2),":",""),SUBSTITUTE(MID(D2,3,2),":",""),RIGHT(D2,2)))
    Last edited by AliGW; 04-12-2021 at 09:31 AM.

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Convert text to hours/minutes/seconds

    Quote Originally Posted by JacobH123 View Post
    I've just noticed a different case where the original text value contains an hour field. eg - 3:31:17. I'm guessing this needs a different formula as is not working with the current one.
    Use AliGW formula for 'version' without hours in text and display as time if text contains hours:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by KOKOSEK; 04-12-2021 at 09:43 AM.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  8. #8
    Registered User
    Join Date
    11-20-2019
    Location
    London, England
    MS-Off Ver
    16.29.1
    Posts
    12

    Re: Convert text to hours/minutes/seconds

    oh great, thanks a lot. saving my day

  9. #9
    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,460

    Re: Convert text to hours/minutes/seconds

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

    Also, 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 all 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. [SOLVED] Convert seconds to years, months, days, hours, minutes snd seconds
    By Tresfjording in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-14-2022, 12:55 AM
  2. convert days hours minutes seconds to just minutes
    By hollylynn in forum Excel General
    Replies: 4
    Last Post: 08-28-2015, 08:53 AM
  3. Convert Days:Hours:Minutes:seconds to minutes.
    By Kevingardner1 in forum Excel General
    Replies: 4
    Last Post: 06-03-2014, 06:44 PM
  4. convert seconds to decimal minutes and hours
    By stoey in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-15-2013, 02:10 PM
  5. [SOLVED] Convert seconds to 1 day 3 hours 25 minutes.
    By bandera in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-28-2013, 10:50 PM
  6. convert from seconds to form hours: minutes: seconds?
    By nguyen_han in forum Excel General
    Replies: 2
    Last Post: 10-13-2011, 06:56 AM
  7. Convert Hours to Minutes and Seconds
    By Jenna11 in forum Excel General
    Replies: 10
    Last Post: 01-08-2007, 09:04 PM

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