+ Reply to Thread
Results 1 to 3 of 3

extracting date from cell that has two spaces

  1. #1
    Registered User
    Join Date
    10-08-2010
    Location
    North Yorkshire, England
    MS-Off Ver
    Excel 2003
    Posts
    69

    Question extracting date from cell that has two spaces

    Hello

    I am trying to extract dates from cells which have variable text length and sometimes have more than one space. I have tried using the following code:

    =RIGHT(B4,LEN(B4)-FIND(" ",B4))

    which works fine on the following examples (though it would be nice to get same date format dd/mm/yyyy)

    BLPD10125 27/09/2013
    BLPD11935 18/07/11

    but doesn't work on following

    CON/ 2009-20-24 / 30-09-12
    because it's recognising that there are two spaces therefore giving following answer:
    2009-20-24 / 30-09-12

    Hope someone can help

    Thanks

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: extracting date from cell that has two spaces

    Try: =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",50)),50))

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

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

  3. #3
    Registered User
    Join Date
    10-08-2010
    Location
    North Yorkshire, England
    MS-Off Ver
    Excel 2003
    Posts
    69

    Smile Re: extracting date from cell that has two spaces

    Thanks Dom, that has worked perfectly

+ 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