How to create dynamic dependent dropdown Lists
Raise your hand if you’ve had to create a tracker for something. Even with all the sophisticated tools available, there will inevitably be situations in our personal and professional lives where keeping track of things in a well designed spreadsheet can be really useful. The whole point of creating a tracker is to keep data organized. So here’s a tip that can help you avoid a common challenge.
Let's talk about dropdown lists. They’re essential to keep data clean, and Excel and Google Sheets have made it easier than ever to create them. With dropdown lists, you can avoid typos and get consistent information that can be used to aggregate information into summary tables and pretty charts (more on that in future posts). So what's the challenge?
The challenge?
You’ve created a beautiful spreadsheet for keeping track of things with a bunch of dropdown lists. Hooray for consistency and avoiding typos! Over time, you’ll need to update your dropdown lists and will start to notice that there are relationships between different dropdown lists that are getting ignored. Uh oh. If I select a value in one list, I need it to narrow down the available options on another list. Personally, this could be expense categories and sub-categories for budgets. Professionally, a common one is organization hierarchy. I only want to pick from a subset of teams based on what gets selected for the department, not a gigantic list of all teams. Without some logic, you end up with structured data from the dropdowns, but the data doesn’t make sense. For example, you end up with a department of Engineering and a team of Accounting.
Create dynamic dependent dropdown lists
First, thank you for allowing me to nerd out on this one. Let’s use the organization hierarchy example and up-level that tracker of yours, and use Google Sheets to walk through how to solve this. It’s not as simple as clicking a button, so here’s how you do it.
First, here’s an example tracking doc so that you can see the solution and practice. You can make a copy to follow along step-by-step.
Step 1: Create a new sheet called ‘mapping’ to get your data organized so that all of your departments and teams are listed in their hierarchy.
The most common way I’ve seen this is with one column with Department names and another column with the related Team names. For example:
Step 2: On the sheet containing your ‘tracker’ data, create a dropdown with the unique list of Departments.
Step 3: Create a new sheet called ‘teamlist’.
This sheet will serve as the output of values based on the Department selections you’ve made in the tracker, and will be referenced to pull dependent values in your Team dropdown list.
领英推荐
=ifna(transpose(filter('mapping'!B:B,'mapping'!A:A=' tracker'!B2)),"")
At a high-level, this is what’s happening in the formula:
Specifically, here's a breakdown of what each component is doing:
'mapping'!B:B - this is the range of values that will be filtered, team names.
'mapping'!A:A=' tracker'!B2 - looks at the value you’ve selected for department in your tracker (sheet tracker where column B is Department) and matches against the list of all departments. Where it finds a match it will filter down to just the relevant list of team names.
Copy and paste the formula down on all rows for your Team List column.
Step 4: On the tracker sheet, create a dropdown for Teams.??
You’ve done the hard part, now the last step is to create a dropdown for Teams on your tracker. Let’s create the dependent list of teams using the ‘teamlist’ you just created.?
Let's test it out. Go to your tracker and select a couple Departments in the dropdown. Now, select Teams using your new dropdown. You should see only the relevant teams for the department you’ve selected for each row.
Things to keep in mind:
Now, sit back and enjoy your new dynamic dependent dropdown lists! Learn more about Growth by Design Talent by visiting our website or subscribing to our newsletter to get talent insights and recruiting leadership tips.
Community & Training Ops @ GBD Talent
1 年Mike Joyner - Thank you for laying out the step by step and reasoning behind why one might use this! My spreadsheets will never look the same!
Enabling Growth Through UX & AI | Building Precious | Ex-Google Policy Specialist | Ex-Lawyer
1 年Excited to check out your article on designing trackers to address common challenges! Mike Joyner
?? Building the best team in space, on Earth ??
1 年Louie O'Connor :)
Founder | Social Media Strategist | Helping Small Businesses Shine Online
1 年This is so helpful! Thanks for sharing. Can’t wait to put this into action.