简体   繁体   English

如何动态填充下拉列表中的值

[英]How to populate values in a drop-down list dynamically

I have the below source data(the original data has thousands of rows)我有以下源数据(原始数据有数千行)

Form  field 
Form1 field11
Form1 field12
Form2 field21
Form2 field22

In a separate sheet, I want to have 2 dropdown lists in field A1 and B1.在单独的工作表中,我希望在字段 A1 和 B1 中有 2 个下拉列表。

The drop-down list in A1 should populate the list of forms eg Form1, Form2 ,etc. A1 中的下拉列表应填充表单列表,例如Form1, Form2等。

The drop-down list on B1 should populate the field based on selection from A1. B1 上的下拉列表应根据从 A1 中的选择填充该字段。

For ex if Form 1 is selected in A1 ,B1 should populate field 11 and field 12 in drop-down list.例如,如果在 A1 中选择了Form 1 ,B1 应填充下拉列表中的字段 11 和字段 12。

screenshots (in reverse order) and function (1st step, bottom)/ sheet here refer:屏幕截图(按相反顺序)和功能(第一步,底部)/此处的工作表请参考:

4] Result 4]结果

预期结果:相关的第二个字段

3] Validation list 'selected cells' relies upon named range: 3] 验证列表“选定单元格”依赖于命名范围:

命名范围“field_selected”

命名范围(主功能区:公式、名称管理器....

(make sure to include # at end to extend to bottom of spill range - assumes you have Excel as part of Office 365 package) (确保在末尾包含 # 以扩展到溢出范围的底部 - 假设您将 Excel 作为 Office 365 包的一部分)

2] Additional spill range specified in cell F4 as follows: 2] 在单元格 F4 中指定的其他溢出范围如下:

过滤功能,取决于第一个验证单元格(选择:H2)

1] Filter function: 1]过滤功能:

=FILTER(E4:E7,D4:D7=H3)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM