+ Reply to Thread
Results 1 to 4 of 4

Convert text into time

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2003
    Posts
    4

    Convert text into time

    Hello.

    I've looked around but I can't seem to find what I'm specifically looking for

    This may sound like a basic question but I'm trying to convert a text string into a time as below

    A1 is "65 hr 29 min 38 sec"

    B1 to be "65:29:38"


    I tried B1=TIMEVALUE(SUBSTITUTE(A1," hr "," min "," sec ")) but it returns #VALUE

    Thanks
    G
    Last edited by satchy321; 12-11-2018 at 08:15 AM.

  2. #2
    Registered User
    Join Date
    02-08-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Convert text into time

    Found my answer
    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1," hr ",":")," min ",":")," sec","")

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,856

    Re: Convert text into time

    The SUBSTITUTE function will return a text value, so perhaps you should do it like this:

    =--SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1," hr ",":")," min ",":")," sec","")

    where the double minus will convert it to a proper time value. Apply a Custom format of [hh]:mm:ss to the cell, to prevent the hours from wrapping at 24.

    Hope this helps.

    Pete

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Convert text into time

    All formulas offered above will only work if each cell would contain hours, minutes and seconds.
    Enter this formula in cell B1 and copy down. Format cells as Custom, [hh]:mm:ss
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 65 hr 29 min 38 sec 65:29:38
    2 25 min 55 sec 00:25:55
    3 15 sec 00:00:15
    4 05 sec 00:00:05
    5 2 sec 00:00:02
    6 1 min 00:01:00
    7 45 hr 31 min 45:31:00
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

+ 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. Convert text to time for a sum
    By Finalfrontier1976 in forum Excel General
    Replies: 1
    Last Post: 09-06-2018, 10:18 AM
  2. Replies: 15
    Last Post: 08-23-2017, 03:32 PM
  3. Excel convert Text time formatted 10h 58m to time so I can sum together
    By slinka in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-04-2016, 10:17 AM
  4. Convert formatted text to fixed text value (time)
    By steez in forum Excel General
    Replies: 2
    Last Post: 04-10-2015, 03:12 PM
  5. 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
  6. Convert time text to value
    By maxthebear in forum Excel General
    Replies: 4
    Last Post: 06-21-2011, 06:31 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

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