如果列包含匹配值,则获取列名称(无需 VBA)
给定命名范围 Table1,如何从数组 Table1[#Headers] 返回该列中存在匹配输入值的所有名称?
a | b | c |
---|---|---|
1 | 2 | 3 |
4 | 5 | 2 |
6 | 1 | 2 |
对于上述示例数据,我想返回
search_value | headers |
---|---|
1 | a,b |
2 | b,c (或 b,c,c) |
3 | c |
通过上述示例数据,我可以使用公式 =SUM(--(Table1=search_value))
计算指定 search_value
的出现次数。鉴于该公式中现有的 True/False 数组,我一直在尝试获取相对单元格映射信息。遗憾的是
XMATCH
仅对一维数组AGGREGATE
很有希望但到目前为止我无法评估CELL("address",{})
(或类似的),这样它返回一个可以与AGGREGATE<一起使用的数组/code>
相关工作簿是托管在 OneDrive 中的共享工作簿,因此我希望尽可能避免使用 VBA。
Given a named range Table1, how do I return all names from the array Table1[#Headers] where a matching input value exist in that column?
a | b | c |
---|---|---|
1 | 2 | 3 |
4 | 5 | 2 |
6 | 1 | 2 |
For the above sample data, I would like to return
search_value | headers |
---|---|
1 | a,b |
2 | b,c (or b,c,c) |
3 | c |
With the above sample data, I can count the occurrences of a named search_value
with the formula =SUM(--(Table1=search_value))
. Given the existing True/False array from that formula, I've been trying to get relative cell mapping information. Sadly
XMATCH
only evaluates on a 1-dimensional arrayAGGREGATE
is promising but I've so far been unable to evaluateCELL("address",{})
(or similar) such that it returns an array that I can use withAGGREGATE
The workbook in question is a shared workbook hosted in OneDrive so I'd like to avoid VBA if at all possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种方法(使用 Office 365)是:
其中 E2 是搜索值。

连接
抱歉 - 我刚刚意识到您想要连接输出:
另一种基于 Excel for Web 的方法
这取决于支持的 SEQUENCE Excel 网页版。希望它能在 Sharepoint 上运行。如果没有,那么有一种(麻烦的)方法可以使用 ROW() 梳理出序列,但如果您不必这样做会更容易。
One way (with Office 365) would be:
where E2 is search value.

concatenated
Sorry - I just realized that you want a concatenated output:
Another approach based on Excel for Web
This depends on SEQUENCE which is supported in Excel for Web. Hopefully, it works on Sharepoint. If not, then there is a (cumbersome) way to tease out sequences using ROW(), but it would be easier if you don't have to go there.