In this post we’re going to learn how to create a conditional drop down list in a cell. This means the drop down list will depend on some other value in the workbook and the available values in the drop down menu will change depending on this value. For example, we might want a user to be able to select from a film genre from a drop down list, then based on this we might want them to be able to select a film within that genre.
To do this we will need to set up a few items in our workbook.
- A cell for our genre selection
- A range for our list of genres
- Ranges for each list of films within each genre
We are going to let the user select from these three genres: Drama, Comedy and Horror.
- Select the first range containing the film genre list
- Change the name to “Genre”
- Repeat for the other three ranges containing the film titles and name them “Drama”, “Comedy” and “Horror” respectively.
- Select the cell where you’re going to select the genre.
- Go to the “Data” tab in the ribbon.
- Select “Data Validation” in the “Data Tools” section.
- Under “Allow” Select “List”.
- In the “Source” input type “=Genre”. This means your drop down list will now contain the values in the range you called “Type”.
- Click on ok.
- Now select the cell where you’re going to select the movie title.
- Go to the “Data” tab in the ribbon.
- Select “Data Validation” in the “Data Tools” section.
- Under “Allow” Select “List”.
- In the “Source” input type “=indirect($B$1)”, where $B$1 is the name of the cell with the movie genre input.
- Click on ok.
Now when you select a genre, the drop down list for the title selection will change depending on the genre. Fancy!
0 Comments