How to Create a Dependent Drop Down List in Excel

Sumit Bansal
Written by
Sumit Bansal
Sumit Bansal

Sumit Bansal

Sumit Bansal is the founder of TrumpExcel.com and a Microsoft Excel MVP. He started this site in 2013 to share his passion for Excel through easy tutorials, tips, and training videos, helping you master Excel, boost productivity, and maybe even enjoy spreadsheets!

An Excel drop down list is a useful feature when you’re creating data entry forms or Excel Dashboards.

It shows a list of items as a drop down in a cell, and the user can make a selection from the drop down. This could be useful when you have a list of names, products, or regions that you often need to enter in a set of cells.

Below is an example of an Excel drop down list:

Dependent Drop Down List in Excel - Simple list

In the above example, I have used the items in A2:A6 to create a drop-down in C3.

Read: Here is a detailed guide on how to create an Excel Drop Down List.

Sometimes, however, you may want to use more than one drop-down list in Excel such that the items available in a second drop-down list are dependent on the selection made in the first drop-down list.

These are called dependent drop-down lists in Excel.

Below is an example of what I mean by a dependent drop-down list in Excel:

Dependent Drop Down List in Excel - Demo

You can see that the options in Drop Down 2 depend on the selection made in Drop Down 1. If I select ‘Fruits’ in Drop Down 1, I am shown the fruit names, but if I select Vegetables in Drop Down 1, then I am shown the vegetable names in Drop Down 2.

This is called a conditional or dependent drop down list in Excel.

Creating a Dependent Drop Down List in Excel

Here are the steps to create a dependent drop down list in Excel:

  • Select the cell where you want the first (main) drop down list.
  • Go to Data –> Data Validation. This will open the data validation dialog box.
Dependent Drop Down List in Excel - Conditional - Data Validation
  • In the data validation dialog box, within the settings tab, select List.
Dependent Drop Down List in Excel - Conditional - List
  • In Source field, specify the range that contains the items that are to be shown in the first drop down list.
Dependent Drop Down List in Excel - Conditional - DD1
  • Click OK. This will create the Drop Down 1.
Dependent Drop Down List in Excel - DD1 Demo
  • Select the entire data set (A1:B6 in this example).
Dependent Drop Down List in Excel - Select Entire Range
  • Go to Formulas –> Defined Names –> Create from Selection (or you can use the keyboard shortcut Control + Shift + F3).
Dependent Drop Down List in Excel - Create from selection
  • In the ‘Create Named from Selection’ dialog box, check the Top row option and uncheck all the others. Doing this creates 2 names ranges (‘Fruits’ and ‘Vegetables’). Fruits named range refers to all the fruits in the list and Vegetables named range refers to all the vegetables in the list.
Dependent Drop Down List in Excel - Top row
  • Click OK.
  • Select the cell where you want the Dependent/Conditional Drop Down list (E3 in this example).
  • Go to Data –> Data Validation.
Dependent Drop Down List in Excel - Data Validation
  • In the Data Validation dialog box, within the setting tab, make sure List in selected.
Dependent Drop Down List in Excel - Settings List
  • In the Source field, enter the formula =INDIRECT(D3). Here, D3 is the cell that contains the main drop down.
Dependent Drop Down List in Excel - Indirect Function
  • Click OK.

Now, when you make the selection in Drop Down 1, the options listed in Drop Down List 2 would automatically update.

Download the Example File

Download File

How does this work? – The conditional drop down list (in cell E3) refers to =INDIRECT(D3). This means that when you select ‘Fruits’ in cell D3, the drop down list in E3 refers to the named range ‘Fruits’ (through the INDIRECT function) and hence lists all the items in that category.

Important Note: If the main category is more than one word (for example, ‘Seasonal Fruits’ instead of ‘Fruits’), then you need to use the formula =INDIRECT(SUBSTITUTE(D3,” “,”_”)), instead of the simple INDIRECT function shown above.

  • The reason for this is that Excel does not allow spaces in named ranges. So when you create a named range using more than one word, Excel automatically inserts an underscore in between words. For example, when you create a named range with ‘Seasonal Fruits’, it will be named Season_Fruits in the backend. Using the SUBSTITUTE function within the INDIRECT function makes sure that spaces are converted into underscores.

Reset/Clear Contents of Dependent Drop Down List Automatically

When you have made the selection and then you change the parent drop down, the dependent drop down list would not change and would, therefore, be a wrong entry.

For example, if you select the ‘Fruits’ as the category and then select Apple as the item, and then go back and change the category to ‘Vegetables’, the dependent drop down would continue to show Apple as the item.

Dependent Drop Down List in Excel - Mismatch

You can use VBA to make sure the contents of the dependent drop down list resets whenever the main drop down list is changed.

Here is the VBA code to clear the contents of a dependent drop down list:

Private Sub Worksheet_Change(ByVal Target As Range)On Error Resume NextIf Target.Column = 4 Then If Target.Validation.Type = 3 Then Application.EnableEvents = False Target.Offset(0, 1).ClearContents End IfEnd IfexitHandler: Application.EnableEvents = True Exit SubEnd Sub

The credit for this code goes to this tutorial by Debra on clearing dependent drop down lists in Excel when the selection is changed. 

Here is how to make this code work:

  • Copy the VBA code.
  • In the Excel workbook where you have the dependent drop down list, go to Developer tab, and within the ‘Code’ group, click on Visual Basic (you can also use the keyboard shortcut – ALT + F11).
Dependent Drop Down List in Excel - developer
  • In the VB Editor Window, on the left in the project explorer, you would see all the worksheet names. Double-click on the one that has the drop down list.
Dependent Drop Down List in Excel - double click
  • Paste the code in the code window on the right.
Dependent Drop Down List in Excel - code paste
  • Close the VB Editor.

Now, whenever you change the main drop down list, the VBA code would be fired and it would clear the content of the dependent drop down list (as shown below).

Dependent Drop Down List in Excel - clear content demo

Download the Example File

Download File

If you’re not a fan of VBA, you can also use a simple conditional formatting trick that will highlight the cell whenever there is a mismatch. This can help you visually see and correct the mismatch (as shown below).

Dependent Drop Down List in Excel - highlight

Here are the steps t0 highlight mismatches in the dependent drop down lists:

  • Select the cell that has the dependent drop down list(s).
  • Go to Home –> Conditional Formatting –> New Rule.
Dependent Drop Down List in Excel - new rule
  • In the New Formatting Rule dialog box, select ‘Use a formula to determine which cells to format’.
Dependent Drop Down List in Excel - use formula
  • In the formula field, enter the following formula: =ISERROR(VLOOKUP(E3,INDEX($A$2:$B$6,,MATCH(D3,$A$1:$B$1)),1,0))
Dependent Drop Down List in Excel - formula
  • Set the format.
Dependent Drop Down List in Excel - format
  • Click OK.

The formula uses the VLOOKUP function to check whether the item in the dependent drop down list is the one from the main category or not. If it isn’t, the formula returns an error. This is used by the ISERROR function to return TRUE which tells conditional formatting to highlight the cell.

Download the Example File

Download File

You May Also Like the Following Excel Tutorials:

Hey! I'm Sumit Bansal, founder of trumpexcel.com and a Microsoft Excel MVP. I started this site in 2013 because I genuinely love Microsoft Excel (yes, really!) and wanted to share that passion through easy Excel tutorials, tips, and Excel training videos. My goal is straightforward: help you master Excel skills so you can work smarter, boost productivity, and maybe even enjoy spreadsheets along the way!

75 thoughts on “How to Create a Dependent Drop Down List in Excel”

  1. Thanks, this was awesome.
    Much simpler than many ways I’ve seen.
    A little side note:
    The formula won’t work if the name isn’t exakt.
    I, for instance, used “:” after my titles. Which couldn’t be picked up by the name manager, and thus it didn’t work, until I removed the colon.

    Reply
  2. Is it also possible to rewrite the formula to apply on whole column ? E.g. in column A I select Vegetable and in column B I will get a drop-down with valid vegetable values. If I change Vegetable value in A to Fruit I would get a drop-down for fruit.

    The expanding the data validation pattern cell by cell in excel is not a solution for me as I’m generating the excel file and not creating it manually.

    Reply
  3. Thank you very much for the video!! what I am trying to do is when you select “India” all the names automatically go down in the column without you selecting one name if you select US all the names in the list will be copies in the column. How can i do it. I have 3 supervisors each have 14 team members under their name and they have to fill out a log. I don’t want them to click 14 times to get their team on the log. Can you please help me. thank you.

    Reply
    • You should instead use the if command. Set each cell below to check if supervisor A is selected in that cell, then set the rest of the cells to fill a certain name. Each cell would be set to only one name per supervisor.

      Reply
  4. This is great, but I have a problem. My Column headers are 2 words and not a single word like “Fruit” or “Vegetable” but rather “Fruit and Vegetable” and “Grains and Breads.” I require a 2 word header value/name. The “named range” uses underscore (_) between each word, which is fine, but the secondary/dependent drop-down does not populate.

    thanks for any tips or advice on a workaround of this nature.

    Reply

Leave a Comment

Get the FREE 51 Excel Tips Ebook

Enter your details and the free PDF is on its way to your inbox.

Hmm, that didn't go through. Please check your email and try again.

No spam. You'll also get my weekly Excel newsletter. Unsubscribe anytime.

Check your inbox!

The ebook is on its way to your email. It usually lands within a couple of minutes.