+ Reply to Thread
Results 1 to 15 of 15

Formula to check 10 alphanumerics

  1. #1
    Registered User
    Join Date
    10-13-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Formula to check 10 alphanumerics

    Hi everyone

    I need help for formula to check the validity of an alphanumeric value in cell. The values are in following shape :

    AAAAA0000A

    ie first 5 should be alphabets (A to Z), next 4 should be numeric (0 to 9) and last one should be alphabet. And all the six alphabets (5 + 1) should be CAPITAL Letters.

    I need formula to check the value of cell whether it fulfills the above mentioned criterion or not.

    Regards.

  2. #2
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Re: Formula to check 10 alphanumerics

    If the cell is A1 which contains your alphanumeric value then in the cell B1 enter the formula =upper(A1)
    that will make all the cell value in A1 to CAPITAL letter.

  3. #3
    Registered User
    Join Date
    10-13-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Formula to check 10 alphanumerics

    Thanks kishore, but my basic concern is to check validity of structure of 10 ie first five are alphabets, next 4 are numerics & last one is alphabet. Its structure of PAN in India and I need to check from the list whether all are in correct format or not.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,594

    Re: Formula to check 10 alphanumerics

    Try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-13-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Formula to check 10 alphanumerics

    Thanks zbor, formula is checking perfectly. Just one question, can't understand the cell range given from A1 to A5 as whats the purpose of this range

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,594

    Re: Formula to check 10 alphanumerics

    It's part of MID function so I must start from there.

    MID(text,start_num,num_chars) must take from text LEFT(A4,5): 1st, 2nd, 3rd, 4th and 5th character (num_chars is 1 because only need one character).
    So it should say something like this:

    MID(text,{1,2,3,4,5}, 1)

    and this array I've create by ROW(A1:A5) return this array.

    So from ABDCR123... will return A B D C and R.
    Then it will take CODE of that characters and check are they between 65 and 90 (A to Z).

  7. #7
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Formula to check 10 alphanumerics

    Quote Originally Posted by zbor View Post
    Try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Your formula fail the following:

    ABCDE-354F
    ABCDE1E34F

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,594

    Re: Formula to check 10 alphanumerics

    Thank you Teethless mama... I guess I can't take a shortcut

    Please Login or Register  to view this content.
    Last edited by zbor; 10-13-2012 at 01:37 PM.

  9. #9
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Formula to check 10 alphanumerics

    Try this ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Marcol; 10-13-2012 at 01:14 PM. Reason: Corrected formula
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,594

    Re: Formula to check 10 alphanumerics

    As I understood it need to check code, not to return upper.
    So your will fail on AbCDE1234F because it should be FALSE.

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Formula to check 10 alphanumerics

    As I understood it need to check code, not to return upper.
    So your will fail on AbCDE1234F because it should be FALSE.
    So try this

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  12. #12
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,594

    Re: Formula to check 10 alphanumerics

    Nice spoted Marcol, mine formula didn't check for 10 chars.
    I've edited my post #8.

  13. #13
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Formula to check 10 alphanumerics

    Using zbors' test for the last character, in my formula in Post #11 we can shorten the formula to ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Marcol; 10-13-2012 at 02:51 PM.

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

    Re: Formula to check 10 alphanumerics

    i have not used MOREFUNC add-in for a very long time, but based on utterances of certain superior xl beings, i have understood that it handles Regular Expression, which is probably the best tool for matching patterns:

    http://www.excelforum.com/excel-form...egex-find.html

    MOREFUNC add-in can be found here:

    http://download.cnet.com/Morefunc/30...-10423159.html
    - 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 -

  15. #15
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Formula to check 10 alphanumerics

    As icestationzbra suggests ...
    If you, and anyone you distribute the file to, have MOREFUNC installed then ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Or
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Marcol; 10-13-2012 at 10:11 PM.

  16. #16
    Registered User
    Join Date
    10-13-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Formula to check 10 alphanumerics

    Thanks zbor, Marcol and icestationzbra. Will try to learn more about MOREFUNC.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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