A while ago we started to explore the capabilities of Excel Data Validation and learned how to create a simple drop-down list in Excel based on a comma-separated list, range of cells or a named range.
Today, we are going to investigate this feature in-depth and learn how to create cascading drop down lists that display choices depending on the value selected in first dropdown. To put it differently, we will make an Excel data validation list based on the value of another list.
How to create multiple dependent dropdown in Excel
Making a multi-level dependent drop-down lists in Excel is easy. All you need is a few named ranges and the INDIRECT formula. This method works with all versions of Excel 365 - 2010 and earlier.
1. Type the entries for the drop-down lists
First off, type the entries you want to appear in the drop-down lists, each list in a separate column. For example, I'm creating a cascading dropdown of fruit exporters and column A of my source sheet (Fruit) includes the items of the first dropdown and 3 other columns list the items for the dependent dropdowns.
2. Create named ranges
Now you need to create names for your main list and for each of the dependent lists. You can do this either by adding a new name in the Name Manager window (Formulas tab > Name Manager > New) or typing the name directly in the Name Box.
Note. Please pay attention that if your first row is sort of column header like you see in the screenshot above, you shall not include it in the named range.
For the detailed step-by-step instructions please see How to define a name in Excel.
Things to remember:
- The items to appear in the first drop-down list must be one-word entries, e.g. Apricot, Mango, Oranges. If you have items consisting of two, three or more words, please see How to create a cascading dropdown with multi-word entries.
- The names of the dependent lists must be exactly the same as the matching entry in main list. For example, the dependent list to be displayed when "Mango" is selected from the first drop-down list should be named Mango.
When done, you may want to press Ctrl+F3 to open the Name Manager window and check if all of the lists have correct names and references.
3. Make the first (main) drop-down list
- In the same or in another spreadsheet, select a cell or several cells in which you want your primary drop-down list to appear.
- Go to the Data tab, click Data Validation and set up a drop-down list based on a named range in the usual way by selecting List under Allow and entering the range name in the Source box.
For the detailed steps, please see Making a drop down list based on a named range.
As the result, you will have a drop-down menu in your worksheet similar to this:
4. Create the dependent drop-down list
Select a cell(s) for your dependent drop-down menu and apply Excel Data Validation again as described in the previous step. But this time, instead of the range's name, you enter the following formula in the Source field:
=INDIRECT(A2)
Where A2 is the cell with your first (primary) drop-down list.
If cell A2 is currently empty, you will get the error message "The Source currently evaluates to an error. Do you want to continue?"
Safely click Yes, and as soon as you select an item from the first drop-down menu, you will see the entries corresponding to it in the second, dependent, drop-down list.
5. Add a third dependent drop-down list (optional)
If needed, you could add a 3rd cascading drop-down list that depends either on the selection in the 2nd drop-down menu or on the selections in the first two dropdowns.
Set up 3rd dropdown that depends on 2nd list
You can make the drop-down list of this type in the same fashion as we've just made a second dependent drop-down menu. Just remember the 2 important things discussed above, which are essential for the correct work of your cascading drop-down lists.
For instance, if you want to display a list of regions in column C depending on which country is selected in column B, you create a list of regions for each country and name it after the country's name, exactly as the country appears in second dropdown lists. For instance, a list of Indian regions should be named "India", a list of Chines regions - "China", and so on.
After that, you select a cell for the 3rd dropdown (C2 in our case) and apply Excel Data Validation with the following formula (B2 is the cell with the second drop-down menu that contains a list of countries):
=INDIRECT(B2)
Now, each time you select India under the list of countries in column B, you will have the following choices in the third drop-down:
Note. The displayed list of regions is unique for each country but it does not depend on the selection in the first drop-down list.
Create a third dropdown dependent on the first two lists
If you need to create a cascading drop down menu that depends on the selections both in the first and second drop-down lists, then proceed in this way:
- Create additional sets of named ranges, and name them for the word combinations in your first two dropdowns. For example, you have Mango, Oranges, etc. in the 1st list and India, Brazil, etc. in the 2nd. Then you create named ranges MangoIndia, MangoBrazil, OrangesIndia, OrangesBrazil, etc. These names should not contain underscores or any other additional characters.
- Apply Excel Data Validation with the INDIRECT SUBSTITUTE formula that concatenates the names of the entries in the first two columns, and removes the spaces from the names. For example, in cell C2, the data validation formula would be:
=INDIRECT(SUBSTITUTE(A2&B2," ",""))
Where A2 and B2 contain the first and second dropdowns, respectively.
As the result, your 3rd drop-down list will display the regions corresponding to the Fruit and Country selected in the first 2 drop-down lists.
This is the easiest way to create cascading drop-down boxes in Excel. However, this method has a number of limitations.
Limitations of this approach:
- The items in your primary drop-down list must be one-word entries. See how to create cascading drop-down lists with multi-word entries.
- This method won't work if the entries in your main drop-down list contain characters not allowed in range names, such as the hyphen (-), ampersand (&), etc. The solution is to create a dynamic cascading dropdown that does not have this restriction.
- Drop-down menus created in this way are not updated automatically i.e. you will have to change the named ranges' references every time you add or remove items in the source lists. To get over this limitation, try making a dynamic cascading drop down list.
Create cascading drop-down lists with multi-word entries
The INDIRECT formulas that we used in the example above can handle one-word items only. For example, the formula =INDIRECT(A2) indirectly references cell A2 and displays the named range exactly with the same name as is in the referenced cell. However, spaces are not allowed in Excel names, which is why this formula won't work with multi-word names.
The solution is to use the INDIRECT function in combination with SUBSTITUTE like we did when creating a 3rd dropdown.
Suppose you have Water melon among the products. In this case, you name a list of water melon exporters with one word without spaces - Watermelon.
Then, for the second dropdown, apply Excel Data Validation with the following formula that removes the spaces from the name in cell A2:
=INDIRECT(SUBSTITUTE(A2," ",""))
How to prevent changes in the primary drop down list
Imagine the following scenario. Your user has made the selections in all of the drop-down lists, then they changed their mind, went back to the first list, and chose another item. As the result, the 1st and 2nd selections are mismatched. To prevent this from happening, you may want to block any changes in the first drop-down list as soon as a selection is made in the second list.
To do this, when creating the first dropdown, use a special formula that will check whether any entry is selected in the second drop down menu:
=IF(B2="", Fruit, INDIRECT("FakeList"))
Where B2 contains the second dropdown, "Fruit" is the name of the list that appears in the first drop-down menu, and "FakeList" is any fake name that does not exist.
Now, if any item is selected in the 2nd drop-down list, no choices will be available when the user clicks on the arrow next to the first list.
Creating dynamic cascading drop-down lists in Excel
The main advantage of a dynamic Excel dependent drop-down list is that you are free to edit the source lists and your drop-down boxes will get updated on the fly. Of course, creating dynamic dropdowns requires a bit more time and more complex formulas, but I believe this is a worthy investment because once set up, such drop-down menus are real pleasure to work with.
As with almost anything in Excel, you can achieve the same result in several ways. In particular, you can create a dynamic dropdown using a combination of OFFSET, INDIRECT and COUNTA functions or a more resilient INDEX MATCH formula. The latter is my preferred way because it provides numerous advantages, the most essential of which are:
- You have to create 3 named ranges only, no matter how many items there are in the main and dependent lists.
- Your lists may contain multi-word items and any special chars.
- The number of entries can vary in each column.
- The entries' sort order does not matter.
- Finally, it's very easy to maintain and modify the source lists.
Okay, enough theory, let's get to practice.
1. Organize your source data in a table
As usual, the first thing for you to do is to write down all the choices for your drop-down lists in a worksheet. This time, you will have store the source data in an Excel table. For this, once you have entered the data, select all of the entries and press Ctrl + T or click Insert tab > Table. Then type a name of your table in the Table Name box.
The most convenient and visual approach is to store the items for the first drop-down as table headers, and the items for the dependent dropdown as table data. The screenshot below illustrates the structure of my table, named exporters_tbl - the fruit names are table headers and a list of exporting countries is added under the corresponding fruit name.
2. Create Excel names
Now that your source data is ready, it's time to set up named references that will dynamically retrieve the correct list from your table.
2.1. Add a name for the table's header row (main dropdown)
To create a new name that references the table header, select it and then either click Formulas > Name Manager > New or press Ctrl + F3.
Microsoft Excel will use the built-in table reference system to create the name of the table_name[#Headers] pattern.
Give it some meaningful and easy to remember name, e.g. fruit_list, and click OK.
2.2. Create a name for the cell containing the first drop-down list
I know that you don't have any dropdown yet :) But you have to choose the cell to host your first dropdown and create a name for that cell now because you will need to include this name in the third name's reference.
For example, my first drop-down box is reside in cell B1 on Sheet 2, so I create a name for it, something simple and self-explanatory like fruit:
Tip. Use appropriate cell references to copy drop-down lists across the worksheet.
Please be sure to read the following few paragraphs carefully because this a very useful tip you that don't want to miss. Thanks a lot to Karen for posting it!
If you plan to copy your drop-down lists to other cells, then use mixed cell references when creating the name for the cell(s) with your first drop-down list.
For the drop-downs to copy correctly to other columns (i.e. to the right), use relative column (without the $ sign) and absolute row (with $) references like = Sheet2!B$1.
As the result, B1's dependent drop down list will appear in cell B2; C1's dependent drop-down will display in C2, and so on.
And if you plan to copy the dropdowns to other rows (i.e. down the column), then use absolute column (with $) and relative row (without $) coordinates like = Sheet2!$B1.
To copy a drop-down cell in any direction, use a relative reference (without the $ sign) like = Sheet2!B1.
2.3. Create a name to retrieve the dependent menu's entries
Instead of setting up unique names for each of the dependent lists like we did in the previous example, we are going to create one named formula that is not assigned to any particular cell or a range of cells. It will retrieve the correct list of entries for the second dropdown depending on which selection is made in the first drop-down list. The main benefit of using this formula is that you won't have to create new names as you add new entries to the first drop-down list - one named formula covers them all.
You create a new Excel name with this formula:
=INDEX(exporters_tbl,,MATCH(fruit,fruit_list,0))
Where:
exporters_tbl
- the name of the table (created in step 1);fruit
- the name of the cell containing the first drop-down list (created in step 2.2);fruit_list
- the name referencing the table's header row (created in step 2.1).
I gave it a name exporters_list, as you see in the screenshot below.
Well, you have already done the major part of the work! Before getting to the final step, it may be a good idea to open the Name Manager (Ctrl + F3) and verify the names and references:
3. Set up Excel Data Validation
This is actually the easiest part. With the two named formulas in place, you set up Data Validation in the usual way (Data tab > Data validation).
- For the first drop-down list, in the Source box, enter =fruit_list (the name created in step 2.1).
- For the dependent drop-down list, enter =exporters_list (the name created in step 2.3).
Done! Your dynamic cascading drop-down menu is accomplished and will update automatically reflecting the changes you've made to the source table.
This dynamic Excel dropdown, perfect in all other respects, has one shortcoming - if the columns of your source table contain a different number of items, the blank rows will appear in your menu like this:
Exclude blank rows from the dynamic cascading dropdown
If you want to clean any blank lines in your drop-down boxes, you will have to take a step further and improve the INDEX / MATCH formula used to create the dependent dynamic drop-down list.
The idea is to use 2 INDEX functions, where the first gets the upper-left cell and the second returns the lower-right cell of the range, or the OFFSET function with nested INDEX and COUNTA. The detailed steps follow below:
1. Create two additional names
Not to make the formula too bulky, create a couple of helper names with the following simple formulas first:
- A name called col_num to reference the selected column number:
=MATCH(fruit,fruit_list,0)
- A name called entire_col to reference the selected column (not the column's number, but the entire column):
=INDEX(exporters_tbl,,col_num)
In the above formulas, exporters_tbl
is your source table's name, fruit
is the name of the cell containing the first dropdown, and fruit_list
is the name referencing the table's header row.
2. Create the named reference for the dependent dropdown
Next, utilize either of the below formulas to create a new name (let's call it exporters_list2) to be used with the dependent drop-down list:
=INDEX(exporters_tbl,1,col_num) : INDEX(exporters_tbl, COUNTA(entire_col), col_num)
=OFFSET(INDEX(exporters_tbl,1,col_num),0,0,COUNTA(entire_col))
3. Apply Data Validation
Finally, select the cell containing the dependent dropdown and apply Data Validation by entering = exporters_list2 (the name created in the previous step)in the Source box.
The screenshot below shows the resulting dynamic drop-down menu in Excel where all blank lines are gone!
Note. When working with dynamic cascading drop down lists created with the above formulas, nothing prevents the user from changing the value in the first dropdown after making the selection in the second menu, as a result, the choices in the primary and secondary dropdowns may mismatch. You can block changes in the first box after a selection is made in the second one by using either VBA or complex formulas suggested in this tutorial.
This is how you create an Excel data validation list based on the values of another list. Please feel free to download our sample workbooks to see the cascading drop-down lists in action. Thank you for reading!
Practice workbook for download
Cascading Dropdown Sample 1- easy version
Cascading Dropdown Sample 2 - advanced version without blanks
329 comments
Hi terry, Please help me, In datavalidation dropdown list which is open by click on mouse but I want to open dropdown list when we select, datavalidation list shouldbe show the option, thank you.
Course| Trainer|Date|Start time|End Time|Duration|Outcome|Notes
for example the above are rows, is it possible if i select course and it give me all the details horizontally? for example In the Course section I select Employee training, and it give me trainer name, date of training, start time etc?
Hi, this post is really awesome. I have 2 questions:
1. Is there a way to reference the INDIRECT formula to another workbook? This means all my data lists for the dropdown boxes are in a different workbook. Is this possible?
2. For the dynamic dropdown with no blanks, is there a way to make it work when the cells are not truly blank? Meaning, they have formulas in them but do not return results so there's no display in the cell but it's not technically blank.
I've been stuck with these for days.
THANK YOU SO MUCH!!!
Hello, Kai,
1. yes, there's a way to reference another workbook for dropdown lists. Please, look at these example pics;
2. replace Named range counta(entire_col) with ROWS(entire_col)-COUNTBLANK(entire_col) in your formulas.
For more details go here
Hi, Is there a way to reference a single primary drop down list....twice? For example if your primary drop down selection is named "vehicle" and one of those selections is "bicycle" then when you select "bicycle" there may be reason to have two non-dependent drop downs like "derailleur type" and "tire size" that would both populate when "bicycle" is selected. The problem I run into is that a named range must be unique...I can only use the primary drop down name once only.
Thanks
Hi have a hazard library with 500 hazard which I want to pick in a list and then I have contributing factors, controls, risks, description which I want to cascade I have only managed to be able to select the hazard and the second column contributoing factors in one cell I can't copy down and I cannot get it to copy across for the varying lists. Any ideas??
Thanks
Svetlana -
Thank you so much for this great tutorial!
In case you followed the directions to the letter and it's still not working, you may have made the same silly mistake I did:
=INDIRECT(A2) refers to the cell in which the first drop down list is located, not the named range. So when you're putting in the second drop down list, you're referencing the cell preceding it. I was referencing the list as it appeared in my reference tab. Silly!
Can anyone help please. I need to create 2 pick lists in excel 2010 for translation service as follows:
select language from (pick list) and select language to (pick list) and the third box should show me a list of translators based on the first 2 selections from the list only. Thanks Same
thanks for your good site
how can i copy a dropdown cell to another cells of a column?
my mean is data validation-list-indirect(A2)
i want copy this in all cells of the column
Remove the last $ in your formula.
Sample:
From $B$2 to $B2
hope this helps.
Hi Svetlana,
I'm trying to load a dropdown list based on doing a VLOOKUP in a data table. For example I load a data table with Orders and Items (only 1 database call) where an Order may have multiple Items.
I want the user to enter an Order # in a cell, then the corresponding Items are loaded into the dropdown list. I presume I want to load the dropdown using some form of VLOOKUP or Index/Match but can't seem to find a solution. Any help is appreciated!
How to use the same formula in consecutive rows?
Hi,
If i want to create a sheet where i need to use the cascading dropdown in the consecutive rows, how can I implement it?
For example, my first row i will select a value from dropdown list In cell A2 and dependent drop down is listed in B2.If I have implement the same in A3 and B3 how should I do it?
I followed the instructions in your example exactly for the dynamic cascading list. However when I select a fruit, no dropdown list appears for exporters. I click on the dropdown button and no dropdown list appears. I can't see anything that I've done wrong. I copied and pasted the name from name manager just to be sure I didn't type it wrong. Any suggestions of likely errors?
Its not working if Named Range values are having space. Deleting the spaces its working..Is there any way to achieve this???
Hello,
I apply the same way and it works for only different values.
the problem is I have 3 dependent drop down lists
the first list contains unique names but the second one has repeated words for each name in the first list and the 3 only depend on them.
I have a long drop down list. Is there a way where typing the first letter will start filtering the drop down list i.e. typing "a" will show only list items starting with "a", continuing typing like "ac" will only show list items starting with "ac" and so on?
Dependent drop down is not working for multiple sheets. Please help
Hello,
I have a question, I have a dropbox with 2 options. Let's say A and B,
when I select option B I want to apear one table with prices. And option A have already it diferent table in the main excel sheet.
I tried but I could not do it.
Please help!!! ASAP
Thanx
Hi
I already have a multiple cascading drop down set.
I need a second non dependant set from the first but cant seem to get it to work....is it possible to have two independence, dependant cascading sets?
Set A of drop down relates to cats, Set B relates to dogs
Can you create an indirect function where if you have a list with three items, say, "fruits", "trees" and "other". You want the dropdown list to appear only for "fruits" and "trees". However, once you choose "other" from the list, I want to be able to enter my own text.
Is this possible? I need a formula or another method rather than indirect function. Please assist.
This tutorial helped me a lot... Thank you!
I have an issue regarding cascading excel dropdown lists that I'm looking forward to solve it as soon as possible...
It is the following,
I created a cascading dropdown list with several dependent entries.
Therefore, I developed a macro to clear contents when updating my ‘mother’ cell. The thing is, I did not want a macro to clear contents, but one to update them, giving me a value instead of a blank cell. I would like to keep the dropdown option in the case I want to change my standard value.
I’m looking forward for someone how could explain it.
Kind Regards,
Fábio Pereira
Portugal
Hi Fabio,
I would like to use a macro like the one you have created. So if I change a selection in a parent menu, I want the following menus to clear.
Could you advise me how you did this ?
Many thanks
Chris