|
Home > Validation > Dependent > Dynamic Dependent Drop Down - Dynamic ArraysLimit choices in one Excel drop down list, based on the value in another cell. This example uses dynamic arrays and spilling to create the lists used in the drop downs. Select a region name, and then select an employee from that region. NOTE: Dynamic arrays are available in Microsoft Excel 365 plans. In versions of Excel without dynamic arrays, see these other ways to set up dependent drop down lists. |

This video shows how to set up dependent drop down lists, based on dynamic arrays that have the items for each list. Select a region name from the first drop down, and the dependent drop down shows only the employees who work in that region

There are written instructions below the video, and the sample file is in the download section at the bottom of the page.
On the Data Entry spreadsheet, there is a list with region and employee names. This list was formatted as an Excel Table. If names are added or removed, the list size will adjust automatically.

In column F and column G, data entry cells are set up at the top of the sheet, where you'll choose a region, and then you'll select an employee from that region.
In the screen shot below, just the headings, fill colour and borders have been added to the data entry cells

After everything is set up, those cells will have drop down lists, as you can see in this animated screen shot.

We want to create a drop down list of region names in cell F2. To get those region names, follow these steps to create a dynamic list of the unique region names. This will be the source range for the drop-down list.
NOTE: When you create a dynamic array, try to leave enough empty rows below the formula cell, and empty columns to the right (if needed). If there's not enough room, Excel will show a #SPILL error, instead of the list

In some drop down list, the items will be easier to find if they're sorted alphabetically. Follow these steps to sort the list of region names.

Next, follow these steps to make a dropdown list of region names, in cell F2

To test the drop down list of Region names:

In cell G2, we want a dynamic drop down list of employees. Instead of showing all the names, we'd only like to see the employees from the region that was selected in cell F2.
To create this dependent drop down list, we'll build another dynamic array formula, using the FILTER function.
Follow these steps to create the formula:

To test the dynamic list, select a different region name in cell F2. The list of employee names changes automatically. Here's the list after the East region was selected, with only 2 employee names showing.

Just like we did with the region name list, we'll use the SORT function in this list, to put the employee names in alphabetical order. Because this list has 2 columns, we'll type a 2 as the second argument, to tell Excel to sort by the 2nd column.
Follow these steps to sort the employee names.

Next, we'll use data validation to create a drop down list of employee names. This is a dependent drop down list -- its contents depend on what region was selected in cell F2.
Because the employee names are in a 2-column list, we'll use the INDEX function to return the names from the 2nd column. In the INDEX function,
Follow these steps to make a drop down list of employee names, in cell G2

To test the drop down list of employee names:


When cell F2 is empty, cell F2 shows a #CALC! error, because there's no region for the filter.

If you'd rather not see that error, use the IFERROR function to show an empty cell, or show a message.
For example, change the formula in cell F7 to the following:
The message, "Select a region", will show, instead of the #CALC! error.

NOTE: Dynamic arrays are available in Microsoft Excel 365
Don't miss my monthly Excel newsletter! You'll get quick tips, article links, and a bit of fun. Add your email, and click Sign Up.
Next, when you get my reply, click the Confirm button. I add this step to protect you from spam!
Dependent Drop Downs, Advanced
Drop Down - Latest Items at Top
Dependent Drop Down Setup Choices
Last updated: September 16, 2024 2:26 PM