+ Reply to Thread
Results 1 to 6 of 6

Allow alphabets and alphanumeric only

  1. #1
    Registered User
    Join Date
    10-19-2011
    Location
    hyd
    MS-Off Ver
    Excel 2003
    Posts
    1

    Allow alphabets and alphanumeric only

    Hi

    I need two formulae in Data validation

    1. Cell should allow only alphabets (a-z and A-Z) and should not allow special charecters like ~,%,$ etc.,
    2. Cell should allow only alphabets, numeric values (a-z , A-Z, 0-9) and should not allow special charecters like ~,%,$ etc.,

    these things I need to implement in my project urgently..
    Please help

    Thanks in advance

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

    Re: Allow alphabets and alphanumeric only

    The simplest way would be to list the alphabet in a column (no need to do both upper and lower, one type will suffice) and then underneath list the numbers 0-9

    You can name the alpha range, e.g. ALPHA and the alpha-numeric range as ALPHANUM


    then data validation, choose custom and enter formula:

    =MATCH(A1,ALPHA,0) for alpa condition

    and

    =MATCH(A1,ALPHANUM,0) for the alphanumeric condition

    where A1 is top-left most cell you select to apply validation to.
    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 Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Allow alphabets and alphanumeric only

    NBVC's way is the best, but if you need additional flexibility, try the below:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-12-2017
    Location
    Scarborough, England
    MS-Off Ver
    2016
    Posts
    1

    Re: Allow alphabets and alphanumeric only

    Can anybody help me with the Data Validation formula for hex codes please, I want my hex codes to come like ex: 4C4F56, not 4c4f56... but I don't know the formula to put in to get it to go like I want - HELP ME PLEASE!

  5. #5
    Registered User
    Join Date
    01-18-2018
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    1

    Re: Allow alphabets and alphanumeric only

    use this formula then it will work fine :-

    =IF(A2="",TRUE,IF(ISERROR(SUMPRODUCT(SEARCH(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),"0123456789abcdefghijklmnopqrstuvwxyz"))),FALSE,TRUE))

  6. #6
    Registered User
    Join Date
    02-27-2020
    Location
    Indonesia
    MS-Off Ver
    2007, 2010
    Posts
    1

    Re: Allow alphabets and alphanumeric only

    Quote Originally Posted by narsingh View Post
    use this formula then it will work fine :-

    =IF(A2="",TRUE,IF(ISERROR(SUMPRODUCT(SEARCH(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),"0123456789abcdefghijklmnopqrstuvwxyz"))),FALSE,TRUE))
    Awesome, event i don't understand how this can works, but this is what i looking for... GREAT

+ 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