+ Reply to Thread
Results 1 to 5 of 5

Extract number data string from text

  1. #1
    Registered User
    Join Date
    06-02-2009
    Location
    philadelphia, ps
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question Extract number data string from text

    Hi,
    My original data has 3 columns.
    The first column contains text, some of which is the following:
    Start Date/Time: 07/27/200822:26
    Start Date/Time: 07/28/2008 00:23

    The second column contains similar data to the first column, some of which is following:
    Stop Date/Time: 07/27/200822:50
    Stop Date/Time: 07/28/2008 01:23

    I would like excel to extract properly formatted date value in the new columns.
    To recap:
    My original data:
    Column 1

    Stop Date/Time: 07/27/200822:26
    Stop Date/Time: 07/28/2008 00:23

    column 2
    Start Date/Time: 07/27/200822:50
    Start Date/Time: 07/28/2008 01:23

    Modified spreadsheet:



    Column 1
    Start Date/Time: 07/27/200822:26
    Start Date/Time: 07/28/2008 00:23

    new column 1
    7/27/2008 22:26
    7/28/2008 00:23

    column 2
    Stop Date/Time: 07/27/200822:50
    Stop Date/Time: 07/28/2008 01:23

    New column 2
    7/27/2008 22:50
    7/28/2008 01:23

    I would appreciate any help.
    Thank you very much.
    Last edited by lamatao; 06-02-2009 at 11:14 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: Extract number data string from text

    Try possibly:

    =(MID(A2,FIND(":",A2)+2,10)&" "&RIGHT(A2,5))+0

    where A2 contains string to convert...

    you may need to format result as Date/Time...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    21,528

    Re: Extract number data string from text

    Alternatively, if the lack of space between date & time in the example:

    Start Date/Time: 07/27/200822:26

    is a typo then you coudl run an Edit -> Replace over the data replacing:

    What: Start Date/Time:
    With: [nothing]

    Repeat for "Stop" column.

    The values should then coerce to date times.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: Extract number data string from text

    I assumed it wasn't a typo..

  5. #5
    Registered User
    Join Date
    06-02-2009
    Location
    philadelphia, ps
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Extract number data string from text

    Thank you very much, it worked!
    I have another problem.
    I import a lot of data from text files into Excel. Excel puts data in the single column.
    I would like to separate the data into 3 columns based on the content.
    I attached 2 files. One file that contains original data, another file shows an example how data should look like.
    Thank you very much.
    Attached Files Attached Files
    Last edited by lamatao; 06-03-2009 at 04:31 PM.

+ 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