Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multiple criteria Custom Data Validation

Posted on 2013-06-21
2
Medium Priority
?
371 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

704 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