google-sheets - 在数据集中查找多个匹配项,并在一行中返回所有匹配项
问题描述
什么数组公式适用于此?
测试表: 打开
当前数据结构
- 包含一个正在运行的名称列表,以及他们何时开始、结束培训。
| A | B | C |
| John | StartDate1 | EndDate1 |
| Adam | StartDate3 | EndDate3 |
| John | StartDate2 | EndDate2 |
| Ted | StartDate5 | EndDate5 |
| Adam | StartDate4 | EndDate4 |
预期成绩
- E 列中唯一的名称列
=UNIQUE(A2:A)
- 在唯一名称旁边,显示与唯一名称匹配的每个 StartDate 和 EndDate。
| E | F | G | H | I |
| John | StartDate1 | EndDate1 | StartDate2 | EndDate2 |
| Adam | StartDate3 | EndDate3 | StartDate4 | EndDate4 |
| Ted | StartDate4 | EndDate4 | | |
我试过的
=FILTER(B2:C,A2:A = E2)
- 不返回单行。❌</li>
- 不适用于 ARRAYFORMULA。❌</li>
=TRANSPOSE(FILTER(B2:C,A2:A = E2:E))
- 返回单行的所有开始日期,以及下一行的所有结束日期。❌
- 它应该返回一行(StartDate、EndDate、StartDate、EndDate 等)
- 不适用于 ARRAYFORMULA。❌</li>
=ARRAYFORMULA(VLOOKUP(E2:E,A2:C,{2,3}))
- 仅返回第一个匹配项❌</li>
- 适用于数组公式。✔️
我究竟做错了什么?是否有更好的数组公式可以连续显示与唯一名称匹配的每个开始和结束日期?
谢谢你的帮助!
解决方案
推荐阅读
- node.js - 无法建立一个或多个指定浏览器连接 / Ubuntu / Firefox Headless
- python - 仅为图像的特定点计算相邻像素的平均像素强度并存储在 n 维数组中
- twitter-bootstrap - 从引导程序 4.1.3 升级到 4.5.0 后,如何修复此按钮布局?
- r - 如何根据某个字符串值重命名列中的某些观察值?
- firebase - 创建用户后 Flutter Firebase 身份验证应用程序崩溃
- javascript - 如何在调整大小时动态地将按钮内的文本居中?
- c# - 在 POST 方法中从 ViewModel 中检索数据
- python - 如何使用 Selenium 和 Python 在 https://www.shopdisney.com/ 中找到 Create an Account 元素
- python - 无法使用 BeautifulSoup 抓取 div 类
- python - 如何使用 tkinter 标签使此功能按顺序工作