+ Reply to Thread
Results 1 to 6 of 6

Extracting 2 dates within a paragraph in a cell

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    2

    Extracting 2 dates within a paragraph in a cell

    Hi there,

    I am trying to get an average time for work being done by searching through work logs and taking the starting and ending dates and subtracting them from each other.

    The problem is that each work log is its own cell, so I have been extracting the dates manually up until now.

    Luckily, both of the dates are contained in one sentence, which is standardized as: "The total time spent on this ticket from 6/28/2011 9:44:13 AM to 7/8/2011 10:51:30 AM is mins." This sentence is not at the very beginning or end of the paragraph, and it is not even in a standardized position.

    Is there a way to extract the dates using a function and place them in the 2 cells to the right of the source cell?

    Thanks.

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

    Re: Extracting 2 dates within a paragraph in a cell

    These worked for the sample you supplied, assuming in A1...

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.
    both need to be formatted 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 Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Smile Re: Extracting 2 dates within a paragraph in a cell

    Hi,

    One way - (probably of several)

    B1:
    Please Login or Register  to view this content.
    C1:
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Extracting 2 dates within a paragraph in a cell

    Yes. It can be done:

    To pull "6/28/2011 9:44:13 AM to 7/8/2011 10:51:30 AM" from inside a text string in cell A1:
    Please Login or Register  to view this content.
    Then:
    B1 = first value
    C2 = second value
    Please Login or Register  to view this content.
    Note you will have to format your cell to a custom format ("mm/dd/yyyy h:mm" or something like that) to display both date and time.
    Last edited by ben_hensel; 05-30-2012 at 04:48 PM.

  5. #5
    Registered User
    Join Date
    05-30-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Extracting 2 dates within a paragraph in a cell

    @ben_hensel

    I do get a few errors for the 2nd value, and I can't seem to figure out why.

    Regardless, this has helped me to populate about 300+ cells, so I'll call it a "SOLVED" for now.

    Thanks!

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Extracting 2 dates within a paragraph in a cell

    Or may be,

    First Date,

    Please Login or Register  to view this content.
    Second Date

    Please Login or Register  to view this content.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

+ 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