Create a Dropdown List of Numbers in Sequence
I Want to Create a Dropdown List of Numbers in Sequence E. G. 1,2,3, .. ., N Using Data Validation. I Open the Validation Dialogue Box, Select List, but What...
I want to create a dropdown list of numbers in sequence e.g. 1,2,3,...,n using data validation. I open the validation dialogue box, select List, but what do i type in the "Source" input box?
Im looking to using a function like the range() function in python to create the list. Is there such function in excel?
2 Answers
To create a comma-delimited list for your drop-down menu, click Source, input the text or numbers, and then click OK.
1st -> Choose the cells in which you want the lists to appear.
2nd -> Select DATA > Data Validation from the ribbon.
3rd -> Change Allow to List in the dialog box.
4th -> To create a comma-delimited list for your drop-down menu, click Source, input the text or numbers, and then click OK.
You can achieve this, fairly easily:
- create a range that you'll be using for your data validation. A simple formula for this is: enter the first element of the range, then, in the next cell, enter the formua: '=previous_cell+1', and drag it until you have what you need.
- Create the data validation as you described, and, in source, select your constructed range, but, instead of, let's say, A1-A20, select A:A (In the data validation source box, usually type a range of cells that contains the value that your dropdown needs, or the values as plain text, separated by comma). The list will be populated with the cells that contain a value and will be extended when the range will grow.
An alternative for the formula from step 1 is to use =Sequence(final_value) formula. This will generate a finite range on a row, that can be used in a data validation.
The correct formula is =SEQUENCE(row, [column]),where you specify the maximum value for the range. Example: =sequence(10) will generate a range of 10 rows, containing the values from 1-10. =sequence(3, 10) will generate 3 rows, with columns containing the values from 1-30. 1-10 for the 1st row, 11-20 for the 2nd and 21-30 for the last.