+ Reply to Thread
Results 1 to 5 of 5

Alpha numeric excel data validation with UPPER

  1. #1
    Registered User
    Join Date
    10-17-2016
    Location
    Guelph, Ontario
    MS-Off Ver
    2013
    Posts
    2

    Angry Alpha numeric excel data validation with UPPER

    I've been working on a formula to force the following input in data validation AB123A1234A and I used the following formula however I now learned that I need to also restrict that input to allow for only capitals but my formula isn't working correctly yet.

    =AND(ISTEXT(LEFT(D1,2)),ISNUMBER(MID(D1,3,2)*1),ISTEXT(MID(D1,5,2)),ISNUMBER(MID(D1,7,4)*1),ISTEXT(LEFT(D1,11,1)),LEN(D1 )=11)

    it failed when I tried the following
    aa123a1234a
    aa12341234a
    aa12aa12345
    1a12aa1234a

    I also just stopped testing at that point. Any help would be greatly appreciated. Thank you in advance.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Alpha numeric excel data validation with UPPER

    Numbers in a text string are evaluated as text, so ISTEXT is no good here. As you can't use arrays in validation, you have to check each of the letters individually.

    =AND(LEN(D1)=11,EXACT(D1,UPPER(D1)),ISNUMBER(--MID(D1,3,3)),ISNUMBER(--MID(D1,7,4)),ISERROR(--MID(D1,1,1)),ISERROR(--MID(D1,2,1)),ISERROR(--MID(D1,6,1)),ISERROR(--MID(D1,11,1)))

    Long formula, but probably the simplest way to do it.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Alpha numeric excel data validation with UPPER

    Certainly simpler than this horror...

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




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Registered User
    Join Date
    10-17-2016
    Location
    Guelph, Ontario
    MS-Off Ver
    2013
    Posts
    2

    Re: Alpha numeric excel data validation with UPPER

    I didn't that ISTEXT had an issue when numbers are in a text string. This is good to know and should definitely help me fix some of my other formula's with errors. Thank you for your help jason.b75 I also appreciate the simplicity of your formula.

    Also thank you Glenn Kennedy your code works as well just far more advanced then jason.b75.

    Thanks !

    Correction Glenn Kennedy you are right since both formulas carry out the same task it cannot be more advanced
    Last edited by taliacrew; 10-19-2016 at 12:25 PM.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Alpha numeric excel data validation with UPPER

    No... not more advanced... merely more complicated!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automated Data Generation in Excel - Auto-Incrementing Custom IDs (Mixed alpha-numeric)
    By piechartking in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2015, 01:47 AM
  2. Replies: 7
    Last Post: 09-21-2015, 01:58 PM
  3. Data validation - alpha-numeric
    By nfn in forum Excel General
    Replies: 1
    Last Post: 07-11-2012, 06:33 AM
  4. Replies: 4
    Last Post: 05-19-2011, 05:29 PM
  5. [SOLVED] In alpha-numeric text data replace alpha
    By manharji in forum Excel General
    Replies: 3
    Last Post: 07-26-2010, 07:20 PM
  6. Replies: 2
    Last Post: 06-18-2010, 05:10 PM
  7. Data validation, alpha or numeric characters
    By tsammons in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2006, 10:10 PM

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