Excel drop down lists

Copper Contributor

Hello-

How do I create a formula for sequential dates in a drop down list?

For example:  I would like to be able to click the drop-down to pick Thursday, August 17, Friday, August 18, Saturday, August 19, etc.

 

I thought it would look something like this but, I can't seem to make it work:

=TODAY()+1, =TODAY()+2, =TODAY()+3, and so on.

 

Also, is there a way to enter a job number from our service software in the spreadsheet and have it pull the specific service address into a certain cell in the same spreadsheet?

 

I am trying to use the spreadsheet as a template in an email for our technicians to fill out cohesively.  My goal is to have the spreadsheet set up with specific drop downs to choose from and then have it automatically be sent to a select group of recipients. 

 

Any help would be appreciated!

10 Replies

@Chanda1625 

The data validation won't accept a dynamic array but you can refer to a spill in the sheet containing the dates.

 

This formula produces an array of 30 dates starting from today:

 

 

=SEQUENCE(30,,TODAY())

 

 

Place it somewhere in the sheet. Then in data validation, refer to the spill:

Patrick2788_0-1692306178349.png

 

Thank you very much for your help! I am still a bit confused what goes in the parenthesis after SEQUENCE. Let's say I want today's date to auto-fill in cell A1. Then in C1 I want the drop down that lists 30 days sequentially from today's date. How does that formula look EXACTLY for putting in the data validation.

I am getting stuck on what the last entry is supposed to be. I think it should look like : =SEQUENCE(30, right here should be column, then this should be the word TODAY for start, then here it is asking for step)

What does it want for column? Location, quantity, or what? Also, what is step that it is asking for? Commas between everything? My brain feels like it is going to explode. lol
right here should be column,

what kind of columns ?

here as source of validation,I guess only require 1 column rather than multiple columns.
Do you need pick one data and fill several columns (e.g. Location quantity) at once?
I guess you can use xlookup formula to fill other column instead.

@Chanda1625 Sometimes Microsoft's documentation is not up to the task, as with the SEQUENCE function.  I recommend checking another source, such as this Ablebits article., that gives more information; that article is explicit in identifying the columns and step arguments as optional quantities, each with a default of 1.

 

Yes, you need to use a comma between each argument.  And note that TODAY is not (just a) word, it is the name of a function, and function names are followed by an open parenthesis, etc.

 

So these formulas are equivalent:

=SEQUENCE(30,,TODAY())
=SEQUENCE(30,1,TODAY())
=SEQUENCE(30,1,TODAY(),1)
=SEQUENCE(30,,TODAY(),1)

 

@Chanda1625 

You can use function arguments to aid in construction of the formula.

 

If you enter =SEQUENCE(   then press Shift+F3 (or click the Fx button) then you'll get this menu:

Patrick2788_0-1692434840906.png

 

 

I actually need the sequence as a drop down that the user can choose one of the dates from to automatically fill in the cell. I would like it to drop down a list of 30 dates from today forward that can be chosen. If that isn't possible, is there a way to have a calendar pop-up to choose a date from?

@Patrick2788 

 

I need the drop down in the Inspection Date column.

 

@peiyezhu 

I actually need the sequence as a drop down that the user can choose one of the dates from to automatically fill in the cell. I would like it to drop down a list of 30 dates from today forward that can be chosen. If that isn't possible, is there a way to have a calendar pop-up to choose a date from?

@SnowMan55 

I actually need the sequence as a drop down that the user can choose one of the dates from to automatically fill in the cell. I would like it to drop down a list of 30 dates from today forward that can be chosen. If that isn't possible, is there a way to have a calendar pop-up to choose a date from?

@Chanda1625 Yes, a dropdown is one of the options for the "data validation" (an Excel technical term, in this case) that Patrick mentioned.  I'll presume that you want those dropdowns in column E.  So

 

  1. Preferably in a separate worksheet, which I will call RefData, use one of those formulas to create your list of thirty values.  Do that by storing the formula into, let's say, cell A2 (allowing A1 to be used for a description).
  2. Format those thirty cells (A2:A31) however you want the dates to appear in the dropdown list.  It looks like you want to use a Custom format of "dddd, mmm dd" or "dddd, mmm d" (without the surrounding quote characters), depending on whether or not you want a leading zero on the first nine days of a month. 2023-08-25 1.jpg
  3. Back on your initial worksheet, highlight all the cells in column E for which you want the dropdown to appear.
  4. In Excel's menus, click Data → Data Tools → Data Validation → Data Validation…; the Data Validation dialog appears: 2023-08-25 2.jpg
  5. On the Settings tab, under "Allow", select "List"; the appearance of that tab changes.  Then under "Source", enter "=RefData!A2#" (without the surrounding quote characters).
  6. You can supply more information to the user using the dialog's Error Alert tab, e.g., mentioning the meaning of those 30 days.
  7. When everything in the dialog is to your satisfaction, click OK.

You can then see the dropdown when you click in one of those column E cells; click its down arrow to show/hide its list.

 

FYI, because the TODAY function is volatile, the formula on the RefData that contains it will be recalculated every time the workbook is opened (and every time anything on any open workbook changes, normally).  So the list of values will always be updated for the current day.