Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
04-05-Create Multiple Dependent Data Validation Lists-Start.xlsx9.5 KB 04-05-Create Multiple Dependent Data Validation Lists-Complete.xlsx
10.7 KB 4.05 create-multiple-dependent-data-validation-lists - Exercise.docx
52.9 KB Exercise - Create Multiple Dependent Data Validation Lists.xlsx
10.5 KB 4.05 create-multiple-dependent-data-validation-lists - Exercise solution.docx
144.1 KB Exercise Solution - Create Multiple Dependent Data Validation Lists.xlsx
11.7 KB
Quick reference
Create Multiple, Dependent Data Validation Lists
Use XLOOKUP to create multiple, dependent data validation drop-down lists.
When to use
We use this technique whenever we want to create a drop-down list that relies on the selection made in a previous drop-down list.
Instructions
In this example, we need to create a drop-down that lists the departments and then another dependent drop-down that lists the employees depending on what department has been selected in the first list.
We also want everything to be dynamic so that if a staff member moves to a different department, the data validation lists update automatically.
Create a Data Validation List - Departments
The first thing to do is create a data validation drop-down that lists the departments.
- Click in cell A7.
- From the Data tab, in the Data Tools group, click Data Validation.
- From the Settings tab, in the Allow section, choose List.
- Click in Source.
- Select the departments.
- Click OK.
Create a Dependent Data Validation List
Now we have our first list, we need to create a second list that depends on the previous selection. There are many different methods to achieve this but we are going to use XLOOKUP.
- Click in a blank cell anywhere in the worksheet.
- Type =XLOOKUP
The XLOOKUP function requires a [lookup_value]. The lookup value is the cell that contains our first data validation list.
The next argument is where we are looking for this information [lookup_array].
The final argument is where we are going to find our answer [return_array].
So, we are looking up the department 'IT' (cell A7), in the range E6:H6 and we are returning the result from cells E7:H19 as our answer could be anywhere depending on the selection.
Notice, we have extended the cell range selection to accommodate any changes.
The result of our formula is a list of the employees depending on which department has been selected in the drop-down.
However, because each department has an inconsistent number of employees AND we extended our selection, we now have zero's in blank cells.
We can use the UNIQUE function to remove these by choosing to show only items that appear exactly once.
- Click in the cell that contains the formula.
We can add the UNIQUE formula with a TRUE argument to show only items that appear exactly once.
This will remove the zero's from the list.
We can now create our second data validation list.
- Click in cell B7.
- From the Data tab, in the Data Tools group, click Data Validation.
- From the Settings tab, in the Allow area, choose List.
- Click in Source.
- Select the first cell of the filtered list and add a # symbol.
- Click OK.
Hints & tips
- We use the # symbol when using dynamic array formulas. The # symbol selects the entire array.
Lesson notes are only available for subscribers.