+ Reply to Thread
Results 1 to 11 of 11

Data Validation - Custom Criteria for two numbers

  1. #1
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Data Validation - Custom Criteria for two numbers

    I have a spreadsheet where I have specific cells that need to be either 9 characters in length or 11 characters in length.

    Currently I am using Data Validation for Text Length Between 9 and 11.

    The issue here is that someone could potentially put in 10 characters and this would then cause problems with some macros.

    Is there a formula I could use in the Custom Criteria option that would enable me to specify that only text length of 9 OR 11 is allowed?

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Data Validation - Custom Criteria for two numbers

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

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Data Validation - Custom Criteria for two numbers

    With A1 is input cell, stay in cell A1.

    Instead of Text Length, go into custom:

    Formula inbox:

    =OR(LEN(A1)=9,LEN(A1)=11)
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Data Validation - Custom Criteria for two numbers

    Hey Sandy, I think I love you!!! I should have been able to work that out as I've used LEN before but it was baffling me this morning!

    Thanks again.

  5. #5
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Data Validation - Custom Criteria for two numbers

    Sorry one more quick question. I have multiple cells and they start at C18, then C25 etc, Does the A1 reference need to change?

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Data Validation - Custom Criteria for two numbers

    Glad to help
    Mark thread as solved, add rep
    Thank you.

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Data Validation - Custom Criteria for two numbers

    DV works on A1, so if you want DV on another cell (s) you need change ref

  8. #8
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Data Validation - Custom Criteria for two numbers

    Do I have to do that on every single cell? I have a lot of lines to add the validation to.....Is there another way to do it?

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Data Validation - Custom Criteria for two numbers

    If cells are in range like A1:A10, you can put DV into A1 and drag it down to A10. If there are single cells you need do DV one by one

  10. #10
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Data Validation - Custom Criteria for two numbers

    Thank you for your help

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Data Validation - Custom Criteria for two numbers

    You are welcome

+ 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. Replies: 11
    Last Post: 12-14-2020, 09:46 AM
  2. [SOLVED] CUSTOM Data validation - 2 (or more) criteria
    By dluhut in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-02-2014, 10:47 AM
  3. Validation Formula for Custom Cell Numbers
    By JWTennisGuy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2014, 02:37 PM
  4. Custom Data Validation That Evaluates for Numbers AND Text
    By jpdawson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-18-2013, 05:05 PM
  5. Custom data validation with multiple criteria
    By gteachman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-29-2011, 01:06 PM
  6. Custom Validation Criteria
    By AHaigh1042 in forum Excel General
    Replies: 1
    Last Post: 02-08-2007, 10:06 PM
  7. [SOLVED] Data Validation - Scroll in the formula bar for a custom criteria
    By Hanno Scholtz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-22-2005, 10:05 AM

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