简体   繁体   English

Excel多个动态下拉列表,不包含空格

[英]Excel multiple dynamic dropdown list without blanks

I am struggling with following exercise: 我正在努力进行以下锻炼:

在此处输入图片说明

Here is a table for the part of data. 这是部分数据的表格。 The first dependent drop-down should belong to annealing (lets say this is the first dropdown) and the second one should be dynamic for material. 第一个从属下拉列表应属于退火(可以说这是第一个下拉列表),第二个从属下拉列表应是动态的。

I've heard it is possible with function: 我听说功能是可能的:

Offset, Index, Match, Offset, Counta, but I am unable to finish and close this function in 250 characters as formula to use dropdown list. 偏移量,索引,匹配,偏移量,Counta,但是我无法完成并关闭此函数(以250个字符为单位)作为使用下拉列表的公式。 The second thing that there should be visible only what is below material for specific material, there should not be any blanks. 第二件事是,对于特定材料,只应显示材料下面的内容,不应有任何空白。

Here is the example how does it look like, but it has to be enriched to work properly. 这是示例,它看起来如何,但必须进行充实才能正常工作。 I presume - by one offset: =Offset(Idex(A:B;Match(D9;A:B;0));1;Countblank(Match(D9;A:B;0))) 我假设-一个偏移量:= Offset(Idex(A:B; Match(D9; A:B; 0)); 1; Countblank(Match(D9; A:B; 0)))

What is more, there should not be indirect formula, because the range of names got used somewhere else, so it's highly recommended to avoid. 而且,不应有间接公式,因为名称的范围在其他地方使用过,因此强烈建议避免使用。

As excel formula, no macros please just to keep it simple. 作为excel公式,请不要使用任何宏来保持简单。

Could you help me with it? 你能帮我吗?

Please let me know if something is not clear. 如果有不清楚的地方请告诉我。

Create one named range that includes the row where all your materials are listed, starting with "Mart" and going across in the row. 创建一个命名范围,该范围包括列出所有物料的行,从“ Mart”开始到该行。

Then you need to create individual named ranges, one for each material. 然后,您需要创建一个单独的命名范围,每种材料一个。 You can just select the cells under "Mart" and give them the range name "Mart". 您可以仅选择“市场”下的单元格,并为其指定范围名称“市场”。 These range names cannot be dynamic, though, they need to point to fixed ranges if you want to use them in dependent data validation. 这些范围名称不能是动态的,但是,如果要在相关数据验证中使用它们,则它们必须指向固定范围。

Edit: If you use relative references in the right places and keep your wits about you when you define them, then you can create one single range name formula for the dependent drop-down. 编辑:如果在正确的位置使用相对引用,并在定义它们时保持机智,则可以为从属下拉列表创建一个单一范围名称公式。

Consider the following screenshot: 考虑以下屏幕截图:

在此处输入图片说明

G2 has data validation with a fixed range name for the materials. G2的数据验证带有固定的物料范围名称。 H2 has a range name that calculates depending on what is in cell G2. H2的范围名称取决于单元格G2中的内容。 The formula is 公式是

=OFFSET(Sheet1!$A$3:$A$10,0,MATCH(Sheet1!G2,Sheet1!$B$2:$E$2,0),COUNTA(OFFSET(Sheet1!$A$3:$A$10,0,MATCH(Sheet1!G2,Sheet1!$B$2:$E$2,0))),1)

When you define this range name, the active cell must be in cell H2, because it will look to the relative reference G2 for the input to the Match function. 定义此范围名称时,活动单元格必须位于单元格H2中,因为它将查找相对参考G2作为Match函数的输入。

Although the different materials have a varying number of rows underneath, the range will adjust to that and only apply to the populated cells. 尽管不同的材料在下面具有不同的行数,但范围将对此进行调整,并且仅适用于填充的单元格。

在此处输入图片说明

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

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