+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Extract last four digits from alphanumberical string

  1. #1
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    100

    Extract last four digits from alphanumberical string

    Hi all,

    I have the following serial numbers in column A:

    03K46L897
    03K41L890 A
    03J86L888
    03P80L886 B
    03K42L891
    03B65L895 A
    03B65L895
    etc...

    Is it possible to extract the last four DIGITS into Column B??
    I tried LEN, MID, RIGHT, LEFT, etc, but had no success...

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

    Re: Extract last four digits from alphanumberical string

    Do you mean you want the L897 codes?

    =RIGHT(TRIM(LEFT(A1,FIND(" ",A1&" "))),4)

    or last 4 digits, without the "L".

    =REPLACE(RIGHT(TRIM(LEFT(A1,FIND(" ",A1&" "))),5),2,1,"")
    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
    04-11-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    100

    Re: Extract last four digits from alphanumberical string

    Thank you NBVC, that was quick...

    basically i want the formula to extract the last digits after the L (or whatever Alphabetical Value). Sometimes there are 3 digits, sometimes 4, less or more. Is that possible?
    03K49L897
    03K41L890 A
    03J76L888
    03P80L886 B
    03K12L891
    03B65L895 A
    03B65L895
    12GQ19012QGR1905
    12GH11069QGR1900
    12RP12001QGR1916
    12RP12002QGR1961
    12MH11008QGR1894
    12GG11092QGR1910 A
    12YY11092QTR1910 B

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

    Re: Extract last four digits from alphanumberical string

    Try:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    100

    Re: Extract last four digits from alphanumberical string

    Many Thanks!!!!!!!! It works...

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Extract last four digits from alphanumberical string

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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