+ Reply to Thread
Results 1 to 7 of 7

Find date in a excel column

  1. #1
    Registered User
    Join Date
    06-19-2009
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Find date in a excel column

    Hi,

    In excel, a column contains 2 dates in between the text. I want to extract these two dates and put in the next succedding columns.

    For example: cell will contain

    The user account was created on 5/2/2008 and the user is contract/temporary. The account will be expired on 5/3/2009

    So I have to retrieve the dates 5/2/2008 and 5/3/2009

    Is there any function / regular expression to find the dates?

    Thanks,
    Iswaria

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find date in a excel column

    This is one way, just to get you started. This just takes your sentence out of A4 and puts the values in A5 and A6...
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-19-2009
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Find date in a excel column

    I have completed the same using VB regular expressions.

  4. #4
    Registered User
    Join Date
    06-19-2009
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Find date in a excel column

    Quote Originally Posted by JBeaucaire View Post
    This is one way, just to get you started. This just takes your sentence out of A4 and puts the values in A5 and A6...
    Please Login or Register  to view this content.
    Thanks for your help!!!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find date in a excel column

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

  6. #6
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Find date in a excel column

    try this macro . your string is in A1 and the two dates are in a2 and a3.

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 06-19-2009 at 02:47 AM. Reason: rectified error in CODE tag

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find date in a excel column

    I think RegExp is an elegant approach, would you care to share your solution iswariak ? I think other members would find it beneficial.

    You may find morefunc.xll of interest, it contains a number of REGEXP functions.
    Last edited by DonkeyOte; 06-19-2009 at 02:49 AM.

+ 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