+ Reply to Thread
Results 1 to 4 of 4

custom data validation for alphanumeric entry

  1. #1
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    custom data validation for alphanumeric entry

    I require a custom formula for in cell data validation of an 5 digit alphanumeric entry.
    The valid format is ANNNN (1 x alpha & 4 x numeric).
    Case of the aplha is not an issue.
    Any help would be appreciated.
    Last edited by wotadude; 05-19-2009 at 04:23 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: custom data validation for alphanumeric entry

    The easiest way to develop a validation formula is to put candidate values in a column (say A), and a formula in col B that returns True if the corresponding entry is valid.

    In the case, you need a formula with AND, LEN, LEFT, and RIGHT functions.

    Then copy the final formula to data validation with references adjusted appropriately.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: custom data validation for alphanumeric entry

    Greetings from the 'Naki.

    To validate A1 use custom validation like

    =AND(LEN(A1)=5,ISTEXT(LEFT(A1,1)),ISNUMBER(VALUE(RIGHT(A1,4))))

    HTH

  4. #4
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: custom data validation for alphanumeric entry

    thanks but....
    Teylyn - that was similar to what i tried too.
    However it still returns true if the first alpha character is substitued for a number.
    But with a bit more creativity i came up with -
    =AND(LEN(A1)=5,ISERROR(VALUE(LEFT(A1,1))),ISNUMBER(VALUE(RIGHT(A1,4))))
    Not pretty but seems to work.

+ 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