+ Reply to Thread
Results 1 to 7 of 7

Using (right) function to find letter not number

  1. #1
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Leeds, England
    MS-Off Ver
    MS Office 2007
    Posts
    134

    Using (right) function to find letter not number

    Hi,

    We have a number of cells in a column similar to these:

    ABC123
    ABC12E
    ABC2A3

    I am trying to find out the letter that is furthest to the right in these strings.

    Example:

    1. would be C
    2. would be E
    3. would be A

    I know the RIGHT function will pull any character is on the right, but is there one for just letters and not numbers?

    Thanks
    Last edited by dvent; 01-06-2009 at 07:51 AM.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    May be something like this with the help of some helper columns?
    Attached Files Attached Files
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Put this new function into a MODULE (same place regular macros go)
    Please Login or Register  to view this content.
    Now, if the code ABC12E is in cell A1, the formula to find E would be:

    =RIGHT(StripNumber(A1),1)
    _________________
    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!)

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    try this array formula, use CTRL+SHIFT+ENTER to commit.

    =MID(B3,MAX(IF(ISERROR(CODE(MID(B3,COLUMN(1:10),1))),0, IF(CODE(MID(B3,COLUMN(1:10),1) )<65,0,COLUMN(1:10)))),1)

    Will return #Value if no letters in text being searched.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Here's an alternative:

    =MID(A1,LOOKUP(2,1/(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))>57),ROW(INDIRECT("1:"&LEN(A1)))),1)

    Richard
    Richard Schollar
    Microsoft MVP - Excel

  6. #6
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Leeds, England
    MS-Off Ver
    MS Office 2007
    Posts
    134
    Quote Originally Posted by RichardSchollar View Post
    Here's an alternative:

    =MID(A1,LOOKUP(2,1/(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))>57),ROW(INDIRECT("1:"&LEN(A1)))),1)

    Richard
    Thanks Richard and all! Great solutions to my problem.

  7. #7
    Registered User
    Join Date
    11-10-2010
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Using (right) function to find letter not number

    Dear Richard Schollar,

    Your formula is great, but I needed the exact same thing but looking from the left, meaning I am trying to find out the first letter in a string.
    I'm trying to figure your formula out and adapt it, but haven't it figure out.

    Thank you for the help!

    AFB

+ 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