Solved

Multiple criteria Custom Data Validation

Posted on 2013-06-21
2
360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Additional Controls in Excel VBA Does Not Show Anything 5 24
Vlookup Help 3 30
multiple unique values in different columns 15 36
Excel - IF criterion 2 24
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

752 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