So far in this Data Validation series, we have learnt to create normal drop down list and dynamic drop down list using different techniques with data validation in Excel.
And, today, in this chapter, we will show you how to create Dependent Drop Down list in Microsoft Excel, using different methods.
Dependent Drop Down list is also known as cascading data validation, and, it limits the choices in a drop down list, depending on the value selected in the other cell that contains data validation. In other words, it depends on the value selected in the first drop down list which determines the values to be displayed in the second drop down list.
This is a very common scenario of working with large data or some dynamic reports, where you want to have 2nd cell display a list that is dependent on the list item chosen in first drop down.
As we know that in excel, there are plenty of ways for doing a particular task and similarly, there are many ways of creating dependent data validation in Excel. And, today, we will demonstrate 5 different techniques to create dependent data validation list.
The raw data can be in any order or format and every time you can’t change the data or format to get what you are looking for.
So, we’ve taken one data set but in 3 different formats to get the dependent drop down list. And, As you can see our data is on the left side that is from column A to column E, and we will have our expected output on the right side that is in column J & K. Column J is going to have the primary validation list whereas the column K will be dependent and will display the values depending on the value selected in the column J.
We have product list for each product code from column A8 to E13. And, we want to select the product code in J10, then depending on the selected product code, a product name in cell K10.
The first method is very simple and short, and it requires only 3 steps to get the depending drop down list. However, it only works successfully until you don’t make any changes to your range. Once, you modify your data then you will have to modify the named range first in order to get the updated cascading data validation.
Follow the steps given below:-
Note: – Spaces and other special characters except underscore and period are not allowed as names. By default, it will be converted into underscore. So, use underscore character and period to separate words. Also, the first letter cannot be a number; it must be a letter, an underscore or a backslash.
Now, we will create drop down list:-
In data validation, to create the dependent list, we have used INDIRECT function to return the value based on the primary data validation list. And, to replace underscore with space, we will use SUBSTITUTE function inside INDIRECT function.
When we select any product code in cell J10 then product list of selected product code will appear in cell K10. For example: – We have selected ETV 501, now you can see dependent product list is appearing in cell K10
Note: – Whenever you will add the product name and product code that will not appear in the list.
For Example: – We have added Product 26 under the ETV 505 product code, but when we select ETV 505 product then added product does not appear in the drop down list.
So, this is how you can create dependent drop down list using simple technique in just 3 simple steps.
In this example, we will see how to get a dependent dropdown list when you have your data like shown in this vertical table.
We will use two different methods to create dependent drop down list. Both are almost similar techniques. However, the one is without the named range and the other will have the named range.
To do the same, we will use OFFSET, MATCH & COUNTIF functions together.
Since we know OFFSET function is used to create the dynamic range, therefore, to create “Dynamic data validation” list, we use OFFSET function to return the dynamic range.
MATCH is used to return the relative position of an item in a list in Excel. And, here it will help us to match the category selected in primary drop down list in our range on the sheet, and it will return a number.
And, COUNTIF is used to get the count of cells that matches criteria. And, here we will use this to count the number of rows to show up by using the COUNTIF function.
Follow the steps given below:-
So, this is how you can get the dependent list by taking cell references in the function.
In the next method, we will use named range in the same function to get the cascading data validation. First we’ve to create the dynamic list for product code. In case of any new product added to the data, the drop down should be updated to display the same.
To do the same, follow the steps given below:-
As we have created a dynamic list for unique products, now, we will create dynamic range for product code range which is in column D.
Follow the same steps which we have followed for unique product:-
=OFFSET(‘Dependent Drop Down List’!$D$20,0,0,COUNTA(‘Dependent Drop Down List’!$D$20:$D$35))
Now we will see what happens when we add any new product code to the list? Will these drop-down lists be updated?
Let’s add new product in the list; Follow the steps given below:-
We have the dynamic headings directly from the table, and we will add new products to the range. The table is in the same format which we used for 1st method.
Follow the steps given below:-
And, now we will create the named range for each heading, follow the steps given below:-
Now, we will prepare the parent drop down list
Now select some item in the J42, say we select “Item 01” and the look at the K42 drop down list. And, like previous 3 methods, we got dependent list here as well.
So, what’s new? In the first example, you could not add any product to the list but here, you can add any new product. So, say we add new product to this item. We go to A45, and we type “ETV-501 Prod 05” and then come back to K42 and here you go. You can see, the new product has been added.
When we select “Item 06”,we go to K42 and click on drop down list. Surprisingly, nothing happens when we click on the drop down arrow. That’s because we have created everything dynamic and forgot to create dynamic range for table which is why the products do not get displayed in the child list.
To do that, we need to use different techniques. There are two methods of doing that. You can either create the table or simply use the OFFSET function only. And, in the next method, we will use OFFSET function, and we’ll see the trick to expand the table range as well.
Now, we go back and select “Item 06 in the J43 cell and return to K43 and click on drop down arrow. But, this time list shows products which we have added for new item. And, we select first product “ETV-506 Prod 01”.
This is how you can create the dependent drop down list using different methods on any type of data format.
Click on the video link for quick reference to the use of it. Subscribe to our new channel and keep learning with us!
If you liked our blogs, share it with your friends on Facebook. And also you can follow us on Twitter and Facebook.
We would love to hear from you, do let us know how we can improve, complement or innovate our work and make it better for you. Write us at firstname.lastname@example.org
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.