Solved

Data Validation List with variable

Posted on 2014-04-29
2
191 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

828 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