Solved

Multiple criteria Custom Data Validation

Posted on 2013-06-21
2
318 Views
Last Modified: 2013-06-21
I have a spreadsheet where the range of cells (E6:E12) must be the numbers 1 through 7 with each number only being used once.  I have added custom validation to the range to not allow duplicates:

=COUNTIF($E$6:$E$12, E6)=1

And that is working fine.  Is there a way I can add a second criteria that the number must be with the range of 1 to 7.  Or what would the VBA code be to do this check?
0
Comment
Question by:amy_goe
2 Comments
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 39266969
Try

=AND(E6>=1,E6<=7,COUNTIF($E$6:$E$12, E6)=1)

if you want to ensure only whole numbers are used, then:

=AND(MOD(E6,1)=0,E6>=1,E6<=7,COUNTIF($E$6:$E$12, E6)=1)
0
 

Author Closing Comment

by:amy_goe
ID: 39267135
PERFECT!  Thank you so much!!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now