Solved

Multiple criteria Custom Data Validation

Posted on 2013-06-21
2
338 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

785 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