Excel Dependent Dropdown List - Multiple Rows

荒凉一梦 提交于 2021-01-29 09:58:10

问题


I am trying to create a dependent drop-down list for multiple rows in excel. Essentially, what needs to happen is that the user can select a value for cell A1 and this value will determine the value that they can select in cell B2. However, I need this to be done for multiple rows - the trouble I run into is that if I just copy the data validation down column B, then in all other rows, it references cell A1, not cell A(x).

Any ideas?


回答1:


You can do this with a combination of named ranges, the indirect formula, and data validation. For every possible outcome in your A1 drop down, you need to create a named range equal to A1. Then, for data validation in your cell B2, use the formula =Indirect(a1)

Example: A1 = (PIZZA or SALAD)

Create two named ranges: In the PIZZA named ranges you may have something like "Cheese, Pep, Jap, Onions, etc,...."
In the SALAD named ranges you may have something like "Ranch, Carrots, Goat Cheese,....etc"

Once you input your equation, your drop down in B2 will depend on what value you have in A1.

This link goes into more detail about what you need. It's worth nothing that this will only work if your values in A1 do not have spaces (named ranges do not allow for spaces). You can work around this by using the substitute function. A2 = Substitute(A1," ","")



来源:https://stackoverflow.com/questions/50684354/excel-dependent-dropdown-list-multiple-rows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!