英文:
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语句,似乎是我最好的选择。
屏幕截图显示的是我一直得到的结果。
英文:
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"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论