+ Reply to Thread
Results 1 to 6 of 6

Extract time from date and time text string

  1. #1
    Registered User
    Join Date
    09-07-2013
    Location
    Launceston, Tasmania
    MS-Off Ver
    Excel 2003
    Posts
    4

    Extract time from date and time text string

    I have imported a heap of date from a crystal report and in excel i get dates and times as follows:

    19/10/2012 3:35:00AM 19/10/2012 4:04:00AM
    22/10/2012 3:50:00AM 22/10/2012 4:20:00AM
    23/10/2012 3:50:00AM 23/10/2012 4:19:00AM
    24/10/2012 3:38:00AM 24/10/2012 3:57:00AM
    25/10/2012 3:24:00AM 25/10/2012 3:54:00AM
    26/10/2012 3:38:00AM 26/10/2012 4:11:00AM
    27/10/2012 5:35:00AM 27/10/2012 6:04:00AM
    28/10/2012 6:40:00AM 28/10/2012 7:09:00AM
    29/10/2012 3:39:00AM 29/10/2012 4:09:00AM
    30/10/2012 4:03:00AM 30/10/2012 4:31:00AM

    I need to convert the time from the text cells into Excel time so I can graph the time differences.
    Can anyone offer a simple way to do this as i have mountains of data.

    Cheers, Matt

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,419

    Re: Extract time from date and time text string

    Looks like you could start with Text to Columns to separate the dates and times.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-07-2013
    Location
    Launceston, Tasmania
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Extract time from date and time text string

    Ok thanks, that separates the times into their own column but they are still text times not numerical.
    How to convert the times?

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Extract time from date and time text string

    Try Find & Replace..
    Find : "AM"
    Replace with : " AM" (with a pre space)

    leave the rest work to Excel..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Extract time from date and time text string

    Alternative you could use these formulas

    =TIME(MID(A1,11,2);MID(A1,14,2),1)

    =TIME(MID(A1,32,2);MID(A1,35,2),1)

    Comments?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Registered User
    Join Date
    09-07-2013
    Location
    Launceston, Tasmania
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Extract time from date and time text string

    Thanks I found the following elsewhere:
    =VALUE(LEFT(B1,LEN(B1)-2)&" "&RIGHT(B1,2))
    This seems to work well although I like the very simple answers you have put forward.
    Thanks for your help.

+ 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. extract specific text and number from a string at the same time
    By doctorexcel in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 07-09-2013, 04:30 AM
  2. [SOLVED] Extract a time from a cell with date and time stamp and then perform calculations
    By Marcos Aristotelous in forum Excel General
    Replies: 3
    Last Post: 10-31-2012, 04:36 AM
  3. Converting a text string to date and time
    By stephboucher in forum Excel General
    Replies: 1
    Last Post: 03-21-2012, 02:28 PM
  4. Replies: 4
    Last Post: 03-23-2010, 12:44 PM
  5. Extract the time from a text string
    By knighttrader in forum Excel General
    Replies: 5
    Last Post: 07-27-2008, 01:52 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