+ Reply to Thread
Results 1 to 4 of 4

How to convert text into time format?

  1. #1
    Registered User
    Join Date
    06-02-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    75

    Red face How to convert text into time format?

    I have excel data file that contains time inserted as text in inconsistent format.

    I need a formula that format the any of these time into text in the form: 00:00 AM/PM

    sample of the data that I see:

    12am "two digits no space between number and am"
    7 pm "1 digit with space between number and pm"
    8:00pm "no space"

    etc.

    I need a formula that reads and exracts this type of data and clean it up as "00:00 AM/PM"

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to convert text into time format?

    You could select the column and replace "am" with " am" and "pm" with " pm", sans quotes.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    Re: How to convert text into time format?

    One option
    =IF(ISNUMBER(FIND("am";A1));--SUBSTITUTE(A1;"am";" am");--SUBSTITUTE(A1;"pm";" pm"))
    + format the cell.
    //Ola

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to convert text into time format?

    If you don't go with the find and replace suggestion, how about:

    =IF(ISNUMBER(A2),A2,SUBSTITUTE(A2,RIGHT(A2,2)," "&RIGHT(A2,2))*1)

+ 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