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 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

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:

  1. 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.
  2. 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.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest