how to display a dropdown dynamically based on more than one possible value selected in a previous dropdown?

huangapple go评论56阅读模式
英文:

how to display a dropdown dynamically based on more than one possible value selected in a previous dropdown?

问题

在Excel中,通过访问数据验证,当前这个公式可以工作:

=IF(A2="A", YES_NO, NO_DATA)

简单来说,如果单元格A2中的值等于"A",则在单元格B2中显示一个下拉列表,其中包含"YES"或"NO"的选项。否则,不做任何操作或显示"NO_DATA"。

我想要做的是类似于以下方式:

=IF( (A2="A" Or A2="B" Or A2="C"), YES_NO, NO_DATA)

换句话说,如果选择"A"、"B"或"C"中的任何一个,就应该显示YES_NO下拉列表。否则,显示"NO_DATA"。

我已经尝试了多种语法,但没有成功。

我尝试在数据验证中使用IF语句,似乎是我最好的选择。

屏幕截图显示的是我一直得到的结果。

英文:

how to display a dropdown dynamically based on more than one possible value selected in a previous dropdown?Currently, this formula works in Excel after accessing Data Validation:

=IF(A2="A",YES_NO,NO_DATA)

In plain language, if the value in cell A2 = "A", then display a dropdown list in cell B2 with the values of YES or NO. Otherwise, don't do anything or NO_DATA.

What I would like to do is something like this:

=IF( (A2="A" Or A2="B" Or A2="C"),YES_NO,NO_DATA) 

In other words, by choosing either A, B, or C, the YES_NO dropdown list should appear. Otherwise, NO_DATA.

I've tried a bunch of syntax efforts with no luck.

I tried using an IF statement within Data Validation. It seemed like my best option.

The screen shot is what I consistently get.

答案1

得分: 0

如果你有两行数据,一行有"是"和"否",另一行有"无数据",那么你可以通过名称管理器引用这些列表。这样会方便很多。

然后你可以在数据验证中使用这个公式:

=IF(OR(A2="A";A2="B";A2="C");YES_NO;NO_DATA)

在这个公式中,YES_NO 是包含"是"和"否"的列表的名称,NO_DATA 是包含"无数据"的列表的名称。

英文:

If you have two rows. One with YES and NO, and one with NO DATA, then you can refer to these lists with the Name Manager. This makes this much easier.

Then you can use this formula in Data Validation:

=IF(OR(A2="A";A2="B";A2="C");YES_NO;NO_DATA)

In this case YES_NO is the name of the list containing "Yes" and "No", and NO_DATA is a list containing "No Data"

how to display a dropdown dynamically based on more than one possible value selected in a previous dropdown?

huangapple
  • 本文由 发表于 2023年2月24日 10:00:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75551993.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定