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
I have to create a document that displays company names in a dropdown list. Once selected. i want another cell to display a dependent dropdown list to show addresses for the selected company name. The only issue is i want to be able to add/remove company names AS WELL as the addresses listed under each.
I understand creating a dynamic cascading dropdown list can allow future edits of the addresses but not sure how to do the same for company name. I want to create a file for someone with no excel experience to be able to add/remove both company name and its associated addresses.
Hi,
I have one master table with an organisation Business units till departments (5 Columns). Now I am looking at the similar Filtering (unique values) functionality based on my list selection in the other dependent cells. If I follow this above method, I end up creating around 120 Named ranges which is next to impossible to remember.
What is the best way to dynamically get the Unique values depending on the selection of top level hierarchy ?
The normal filtering in excel on this table shows the unique values, However I want this filtering on the cell that I want the values.
Pl. help
Vijay
I want to run a macro on the basis of different selections from drop down list, is this possibl?
Thank you for posting this tutorial. Using it, I was able to set up the dependent drop down lists I needed. Now I need to figure out how to make them work across multiple tabs. The problem is stemming from the initial cell reference. Here's my example:
NAME: CELL_1_DOOR_TYPE
FORMULA: ='1ST FLOOR'!$C$5
It works perfectly on the 1ST FLOOR tab. The problem is, of course, that if you're on 2ND FLOOR, 3RD FLOOR, etc., it references C5 on the 1ST FLOOR tab.
Is there a way to force the named formula to always reference C5 on the active tab or must I recreate the named formulas for each tab?
Thanks in advance!
I also have same issue.
I want to make a list using the following:
I have a category for Ex. Business
And i Want to show the different type of business by simply clicking on the category of business
can you help me how to make this in excel.
Thank you.
I have a drop down list A1 with Name, List B1 is phone number, C1 is Text, and D1 is Email. After I click a name I would like the corresponding phone number, Text(just the word) and Email(Just the word)in the next drop down. Also be able to choose the same name with a couple of times but with either number, test and or email I can attached a copy of what i have if need be
I have created a drop-down list on a master sheet. I have 22 sheets with identical columns to the master sheet. The only difference between these sheets is how many rows there will be with data entered. (Some cells in some rows will be blank- this is necessary.) Can you please explain how I can have a drop-down selection link to a specific worksheet and populate the current sheet (in this case it would be the master sheet) with the data in the cells from the sheet selected in the drop-down? For example, I would like to select a rep's name in the drop-down box, and it populates with that rep's sheet (the rep's sheet will have a 4 digit number as the name of the sheet). Any and all assistance is greatly appreciated. Thank you.
I have created my lists.
I have the primary drop-down working!
My 2nd drop-down isn't working. I have my ranges named using "offset" formula as the lists may frequently change. When I make the secondary list NOT using offset, it seems to work okay.
Any tips?
Hello, Trey,
To help you better, we need a sample table with your data in Excel. You can email it to support@ablebits.com. Please add the link to this article and your comment number.
Very helpful. Thanks!
i have small problem in excel. it is i am created a drop down in the excel. like this Ex: B is 1,2,3,4,5.... and C is 45,56,59,58,26..
but iam select B1 then automatically C Cell become changed into 45.
how is it please solve my problem. thanking you
hello!
How can one create dependent value to drop down list?
If in cell B3 one chooses one value from drop down list, excel automatically in cell C3 drops dependent value.
Example - in drop down list I choose customer and automatically in next cell I get address for chosen customer. Is that possible to do in excel?
Hello, Zane,
Looks like you need VBA. Sorry, we cannot help you with this.
Hi,
I have a spread sheet with 2 dropdown list and it is working fine using indirect function. Problem is when i erase the value in the first dropdownlist column the second dropdown list value stand still. Is there a way that if I delete the value in the first dropdown the second dropdown will be removed as well?
Thanks.
Mike
Hello, Mike,
Most likely you need a VBA macro that will react to changes in the cell. Sorry, we cannot help you with this task.
It was a great article it really helped me alot.Thanks alot for you help. I really appreciate your time and help. Thanks again :-) buddy
I just want to say thank you for your generosity. This tips will make me perform better at work. I made a search for this in the internet for a while, and your website was the only one to post the exact answer.
Hi
Great post, very helpful. However, each of the list in my table is mixed, it might look like this;
Apricot
Apricot Italy
Apple Morocco
Mango China
Chile Apricot
Rather than separate out the individual lists, how can I make the 2nd drop down list only show those values that word match the 1st drop down, i.e Apricot Italy and Chile Apricot?
Probably not the most elegantly written post.
Cheers
Hello, Paul,
Sorry, it's not possible the way you describe. You should add another column and filter it using the formula.
I have 2 columns in a spreadsheet, both are picked from a drop down list.
Col A is "Do you want more information" - Possible Values Yes\No
Col B is "How did you hear about us" - Possible values are Email\Phone\Other
Question: If "No" is chosen in Col A, then Col B's value should be N/A, otherwise the user should be able to choose from the dropdown and pick a value. Using the following formula, I can get N/A to appear, but the "false" option overwrites any available dropdown values or previously selected values. So simply put, if Yes is chosen, let user choose a value in the other cell. If No is chosen, show N/A in the other cell. Thoughts on how I can get this to work? or how it's work with data validation?
Thanks for the tutorial.
Help me a lot with my problem.
Sir,
Please help me to get dropdown list based on the followings:
I have a list of names, how to create dropdown list to populate the list of the words to display when the first, then second letter (and so on) of the word typed.
Good day,
Thank you soo much for the assistance. I have managed to create a multiple word cascading drop down list. The problem is that the result on the dependent list only references to whatever is on the first row of the main drop down list. How can i correct this?
I have one question.
I have Banks
Abank
Bbank
Cbank
And Eachbank has same currency
USD
GBP
EUR
CHF
JPY
And Each Currency has some special Number
Abank USD SPECIAL NO 111
Bbank USD SPECIAL N0 112
Cbank USD SPECIAL NO 113
same for EUR,CHF,JPY,GBP
I this stiuation
When i selected First Dropdown i wanted to show Banks-
Second dropdown wanted to show All currencies-
Third dropdown wanted to show Special no
Let me give you and example
IF Abank selected on DRPList1
and USD selected on DRPList2
show only ABANK USD SPECIAL NO 111 on DRPList3
IF Bbank selected on DRPList1
and USD selected on DRPList2
show only BBANK USD SPECIAL NO 111 on DRPList3
But it is always showing ABANK USD SPECIAL NO 111 DRPList3
So how can i connect lists if my banks has same currencies and this each same currencies has different special number
Thanks