+ Reply to Thread
Results 1 to 3 of 3

Extracting dates from a cell that contains text

Hybrid View

  1. #1
    Registered User
    Join Date
    08-24-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2010
    Posts
    11

    Extracting dates from a cell that contains text

    Hello,

    I have a cell that shows this: "test [ 7/1/2012 -> 8/24/2012 ]

    I would like to be able to just have the 2 dates show up in two different cells so I can then calculate how many days there were in between the 2 dates.



    Let me know if you can help!

    Thank you

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Extracting dates from a cell that contains text

    Beginning Date: =TRIM(MID(A1,FIND("[",A1)+1,LEN(A1)-FIND("->",A1)-4))
    Ending Date: =TRIM(MID(A1,FIND("->",A1)+3,LEN(A1)-FIND("->",A1)-4))

  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

    Re: Extracting dates from a cell that contains text

    Hi

    One way
    =VALUE(MID($A1,FIND("[",$A1)+2,FIND("->",$A1)-2-FIND("[",$A1)))
    =VALUE(MID(A1,FIND("->",$A1)+2,FIND("]",$A1)-1-FIND("->",$A1)-2))

    both formatted as number
    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.

+ 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