+ Reply to Thread
Results 1 to 7 of 7

Data Validation to only allow a 12 digit HEX value

  1. #1
    Registered User
    Join Date
    05-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    25

    Data Validation to only allow a 12 digit HEX value

    Hi Smarter than me People,

    I am looking for a way to apply data validation to cells, but limit the cell input to 12 digit hexadecimal, i.e., 0-9,A-F.

    In other words when the data entry is done for these cells, the only thing that can be entered is a 12 digit HEX

    I have tried some data validation with text, different variations of cell format, but nothing really seems to satisfy what I am looking for.

    Any insight and help, as usual, is greatly appreciated.

    tks,

    Tim

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Data Validation to only allow a 12 digit HEX value

    Hi Tim,

    I think you need a Custom Validation rule on those cells that looks like this:

    =AND(LEN(A2)<13,ISERROR(HEX2DEC(A2))=FALSE)

    See the attached for the example.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    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: Data Validation to only allow a 12 digit HEX value

    Marvin, Hex2Dec only works for up to 10 characters in Excel 2010. Have they extended it for 2013?
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    05-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Data Validation to only allow a 12 digit HEX value

    I tried this, but it does appear to not work for anything larger than 10 characters. (I am using Excel 2010, btw)

  5. #5
    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: Data Validation to only allow a 12 digit HEX value

    How about ...

    =AND(LEN(A2) <= 12, ISNUMBER(HEX2DEC(LEFT(A2, 10)) + HEX2DEC(MID(A2, 11, 2))))

  6. #6
    Registered User
    Join Date
    05-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Data Validation to only allow a 12 digit HEX value

    Thanks shg, that does exactly what I was looking for.

    tks,

  7. #7
    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: Data Validation to only allow a 12 digit HEX value

    You're welcome. Just a minor change to Marvin's suggestion.

+ 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. [SOLVED] Data validation list - country names are selections but 2 digit codes need to be result
    By Grilleman in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-07-2014, 11:28 AM
  2. [SOLVED] LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash
    By david gonzalez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2014, 12:57 AM
  3. [SOLVED] Data Validation into 10 or 7 digit number
    By freeSky in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-21-2012, 09:24 AM
  4. Replies: 7
    Last Post: 05-06-2009, 07:29 PM
  5. Data Validation for 5 digit alpha entry only
    By wotadude in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2008, 03:34 PM

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