How-to recipes · Workbooks and sheets
How to create a dependent drop-down list in Excel
Make a second drop-down that shows only the options for the first choice, with FILTER in Microsoft 365 or named ranges and INDIRECT in older Excel.
A dependent (or cascading) drop-down changes its options based on another cell: choose Vegetable in the first list and the second list offers only Carrot and Leek; choose Fruit and it offers Apple, Banana and Cherry. It is a common need in order forms, expense sheets (category and subcategory) and address forms (country and city). The modern method uses one FILTER formula; the classic method, which works in every version, uses named ranges and INDIRECT.
The example data
A two-column list of categories and items in A1:B8. The user picks a category in E1 (itself a normal drop-down) and should then pick an item from a list that depends on it.
Microsoft 365 and Excel 2021: FILTER
First create the category drop-down in E1 as described in How to create a drop-down list in Excel, using =SORT(UNIQUE(A2:A8)) as its source list. Then build the dependent list with FILTER in a spare area, for example G2:
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Category | Item | Choose | Vegetable | |||
| 2 | Fruit | Apple | Carrot | ||||
| 3 | Fruit | Banana | Leek | ||||
| 4 | Fruit | Cherry | |||||
| 5 | Vegetable | Carrot | |||||
| 6 | Vegetable | Leek | |||||
| 7 | Dairy | Milk | |||||
| 8 | Dairy | Cheese |
With Vegetable in E1, FILTER returns only the two vegetables. Change E1 and the list changes.
- Select the cell for the second drop-down, for example E2.
- Data > Data Validation > Allow: List.
- Source:
=$G$2#. The#refers to the whole spilled FILTER result, however long it is. - Click OK. E2 now offers only the items that belong to the category in E1.
This approach needs no named ranges, works with any number of categories, and updates automatically when you add rows to the source list. If the list is in a table, use =FILTER(Items[Item],Items[Category]=E1). You can hide column G or place the helper formula on a separate sheet.
Several rows of drop-downs
The spill trick needs one helper range per row, because each row can have a different category. For a form with many rows, either give each row its own helper column (convenient with TRANSPOSE(FILTER(...)) spilled across a row), or use the OFFSET/MATCH method below, which works without helpers when the source is sorted by category.
Excel 2016 and 2019: named ranges + INDIRECT
- Arrange the items in columns, one column per category, with the category name as the header: Fruit in one column, Vegetable in the next, Dairy in the third.
- Select the whole block including headers and choose Formulas > Create from Selection > Top row. Excel creates the names Fruit, Vegetable and Dairy, each referring to the items below its header.
- Create the first drop-down in E1 with the three category names as its source.
- Select E2, open Data Validation, choose List and enter the source
=INDIRECT($E$1).
INDIRECT turns the text in E1 (Vegetable) into a reference to the range with that name, so the second drop-down shows its items. Named ranges are explained in Named ranges: give cells meaningful names.
=INDIRECT(SUBSTITUTE($E$1," ","_")) as the source to translate the visible category into the name. Create from Selection does this replacement automatically when it builds the names.Without helper columns: OFFSET + MATCH
If the source list is sorted by category (as in A1:B8), the source of the second list can be calculated directly: =OFFSET($B$1,MATCH($E$1,$A$2:$A$8,0),0,COUNTIF($A$2:$A$8,$E$1),1). MATCH finds the first row of the category and COUNTIF how many rows it has. This works in every version but breaks silently if the list is not sorted.
Clearing the second choice
If someone selects Fruit and Apple, then changes the category to Dairy, E2 still says Apple. Validation does not re-check existing values. Highlight such mismatches with conditional formatting (=COUNTIFS($A$2:$A$8,$E$1,$B$2:$B$8,$E$2)=0), or clear E2 automatically with a short event macro, explained in Events: macros that run by themselves.
Pitfalls
- INDIRECT is volatile and recalculates constantly; on very large sheets with thousands of dependent cells it can slow things down. The FILTER method is lighter.
- INDIRECT does not work with spill references or table names inside validation in older versions. Use plain named ranges there.
- Typos in categories (Vegetable vs Vegetables) leave the second list empty. Make the first list a drop-down so the names always match.
- Copying to another workbook keeps the validation formula but not always the named ranges. Check the names in Formulas > Name Manager.