+ Reply to Thread
Results 1 to 5 of 5

Find All Characters After Last letter in String

  1. #1
    Forum Contributor
    Join Date
    11-28-2005
    Location
    Dover, England
    Posts
    172

    Find All Characters After Last letter in String

    I have a string which contains both alpha numeric/characters and I need to extract all of the characters after the last letter. As an example I have:
    ASDFG 123 4 SDFGH 6.0
    SDFFGH 2562 SDFGGHJH aDFGGH 6.0 - 6.1

    All I want is the 6.0 and 6.0 - 6.1

    Is there anyway I can extract this information?

    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: Find All Characters After Last letter in String

    Try, assuming strings start in A1:

    =TRIM(SUBSTITUTE(A1,LEFT(A1,(MIN(FIND(0,SUBSTITUTE(UPPER(A1),CHAR(ROW(INDIRECT("97:122"))),0)&0)-3))),""))

    copied down
    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 Contributor
    Join Date
    11-28-2005
    Location
    Dover, England
    Posts
    172

    Re: Find All Characters After Last letter in String

    NBVC - many thanks for responding. My detail starts in cell reference H2 which I have changed in the formula however, the I am getting an error which is something to do with the "97:122" part of the formula. I am using I am using a 2003 version. Regards

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

    Re: Find All Characters After Last letter in String

    Actually, I am not sure it's the perfect formula... if it works for you great... you can actually just change to this:

    =TRIM(SUBSTITUTE(H2,LEFT(H2,(MIN(FIND(0,SUBSTITUTE(UPPER(H2),"z",0)&0)-3))),""))

    it works for the samples you gave.

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Find All Characters After Last letter in String

    i found this CSE formula to be a little more robust:

    Please Login or Register  to view this content.
    Last edited by icestationzbra; 09-14-2012 at 08:59 PM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

+ 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