Solved

Data Validation List with variable

Posted on 2014-04-29
2
194 Views
Last Modified: 2014-09-17
How to make a drop down list using numbers from 1 to x. x is a variable that can be set.
0
Comment
Question by:WTC_Services
[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
2 Comments
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40031772
Slight confusion in the question. Do you want a dropdown or do you want Data Validation?

There is an option in Data Validation for Whole Numbers whereby you specify the Minimum and maximum values. Each of these can be linked to a cell so you can set the Minimum to 1 if so required and link the maximum to a cell to give the variable maximum.

When using Data Validation for a range of numbers it doesn't give the option for a drop down list like text entries do.

Alternatively, you could create a list starting at 1 and using an IF statement to increment by 1 if smaller than Maximum and then create a Dynamic named range on that list to use as a list option for the DV.

Thanks
Rob H
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 40031807
See attached with Dynamic List for Data Validation dropdown.

I have created a list in column J based on Maximum in K1. This increments by 1 if less than or equal to maximum otherwise zero. This only goes to row 40 but you could extend further if you wished by copying the formula further down.

I then a Dynamic named range on this list using the Offset function:

=OFFSET(Sheet1!$J$1,0,0,COUNTIF(Sheet1!$J:$J,"<="&Sheet1!$K$1),1)

If you need the Offset function explaining, let me know.

This named range is called NUMBER_LIST which is then the source list for the Data Validation in F3

Hope that helps.

Thanks
Rob H
Dynamic-Dropdown.xlsx
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
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.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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