+ Reply to Thread
Results 1 to 13 of 13

Custom Data Validation

  1. #1
    Forum Contributor
    Join Date
    08-30-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    142

    Custom Data Validation

    I'm struggling with some data validation which I'm sure is pretty simple but any help would be appreciated.

    I want the validation to restrict only 24 characters 9 numbers/14numbers e.g. 123456789/12345678901234

    Thanks again

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Custom Data Validation

    Try this for your data validation formula, replacing A3 with the actual cell reference:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 02-10-2014 at 04:01 PM. Reason: Cell ref in description didn't match formula, updated description
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Custom Data Validation

    @ 6StringJazzer,

    This is a hard one for me. Your formula works partially since it wont limit the Right Value to 14 characters only.

    I am having a hard time trying to figure this out.

    Kind Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Custom Data Validation

    Oh, good point, then:

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

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Custom Data Validation

    @ 6StringJazzer,

    Note: Got your name correct this time.

    I was just about to suggest the "Len" function as, =IF(LEN(A3)<>24,TRUE), and just that.

    Why bother with the rest?

    Kind Regards.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Custom Data Validation

    @ 6StringJazzer,

    Sorry, the formula should read: =IF(LEN(A3)=24,TRUE,FALSE)
    Last edited by Winon; 02-10-2014 at 04:33 PM. Reason: Corrected Cell reference

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Custom Data Validation

    As I understand the problem, you want no more than 9 numbers to the left of / and no more than 14 to the right of /. I think that this will do what you want.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Custom Data Validation

    @ newdoverman,

    Your formula does not seem to work with DV in the actual cell.

    Kind Regards

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Custom Data Validation

    Oops! Wasn't meant for DV but column next to numbers.....should have stated that.

    I can't figure a way to get DV to accept a double criteria as requested.

  10. #10
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Custom Data Validation

    Quote Originally Posted by Winon View Post
    Why bother with the rest?
    Well, because it works. It ensures that all criteria specified by the OP are included in the validity check. I tested it in the attached.

    Notwithstanding newdoverman's solution, I interpreted the OP as:

    Exactly 9 digits followed by the character "/" followed by exactly 14 digits.

    Maybe I didn't understand your question, but there are several things to check besides just the overall length. By the way, in your second formula, the expression

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


    is correct but is equivalent to

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


    It is not necessary to use IF to produce a Boolean when the expression you are testing already returns a Boolean.

    I would be very interested to have Ted Dennis return to tell us if any of this solves his problem....
    Attached Files Attached Files

  11. #11
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Custom Data Validation

    @ 6StringJazzer,

    Yes you are correct, your amended formula with the Len function, works like a charm.

    I had a couple of cells to experiment with various options, and in a moment of "weakness", I got totally carried away, and drifted off the actual requirements.

    Sorry about that!

    Kind regards.

  12. #12
    Forum Contributor
    Join Date
    08-30-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    142

    Re: Custom Data Validation

    Sorry for the time its taken to get back to you guys. Firstly thank you for everyones input. Having read through the thread the first formula I tried was 6String Jazzer's -


    =AND(LEN(A3)=24,ISNUMBER(VALUE(LEFT(A3,9))),ISNUMBER(VALUE(RIGHT(A3,14))),MID(A3,10,1)="/")

    This has worked exactly as required.

    To clarify the DV was for 9 characters followed by a "/" followed by another 14 characters

    Thanks again



    Many Thanks

  13. #13
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Custom Data Validation

    You're welcome! Thanks for the rep, and thanks for marking your thread Solved!

+ 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. Custom data validation
    By superboy in forum Excel General
    Replies: 0
    Last Post: 01-20-2014, 12:05 PM
  2. Custom Data Validation
    By Brenda42 in forum Excel General
    Replies: 4
    Last Post: 08-15-2011, 02:06 AM
  3. Custom data validation??
    By turbofatty in forum Excel General
    Replies: 3
    Last Post: 08-02-2011, 10:24 AM
  4. Excel 2007 : Custom Data Validation
    By superman_86 in forum Excel General
    Replies: 1
    Last Post: 11-11-2008, 04:47 PM
  5. [SOLVED] Data Validation - Custom
    By Mary Ann in forum Excel General
    Replies: 4
    Last Post: 12-17-2005, 05:25 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