【问题标题】:How do you convert a Google Sheet to a different layout? Combine multiple rows that have the same data into one row, and concat unique data in 1 cell如何将 Google 表格转换为不同的布局?将具有相同数据的多行合并为一行,并在 1 个单元格中连接唯一数据
【发布时间】:2022-01-01 01:13:30
【问题描述】:

是否可以将 Sheet #1 中的数据转换为 Sheet #2 中的格式


Sheet1 - 当前数据集。

# A B C D E F G H I
1 - Employee ID Class ID
2 - 555555 - - - - - - Class004
3 - 888888 - - - - - - Class004
4 - 777777 - - - - - - Class004
5 - 333333 - - - - - - Class004
6 - 666666 - - - - - - Class002
7 - 111111 - - - - - - Class002
8 - 222222 - - - - - - Class002
9 - 222222 - - - - - - Class009

Sheet2 - 使用公式的预期结果。

# A B C
1 - Class ID Employee ID's
2 - Class004 555555 888888 777777 333333
3 - Class002 666666 111111 222222
4 - Class009 222222
  • B 列包含每一行的唯一类 ID。

    • 一个类 ID 可能有 4-20 个字符,它可能看起来像:“Class001”、“CID001”、“V001”或其他(因为创建此数据的人无法决定统一格式哈哈)

    • 目前我正在使用这个公式。有没有更好的公式? =UNIQUE(Sheet1!I2:I) 放在Sheet2!B2。

  • C 列在一行中包含所有参与该特定课程的员工 ID(以空格分隔)。

    • 一些员工参加了多个课程(例如员工 222222 在 Class002 和 Class009 中),因此可以在多行中找到相同的员工 ID。
    • 我尝试在Sheet2!C2 中使用=ARRAYFORMULA(VLOOKUP(Sheet2!B2:B,Sheet1!{I2:I,B2:B},2,0)),但这只会返回第一个匹配项。也许有一种方法可以使用 vlookup 返回与 Class ID# 匹配的所有员工 ID 的数组,转置它们,然后连接它们?你有什么建议?

感谢您的帮助! :)

【问题讨论】:

  • 您对arrayformula解决方案感兴趣吗?

标签: google-sheets google-sheets-formula vlookup array-formulas index-match


【解决方案1】:

试试:

=JOIN(" ",FILTER(Sheet1!B:B,Sheet1!I:I=B2))

然后将其向下拖动到其他类

【讨论】:

  • 这非常适合我的需要。谢谢你:)
猜你喜欢
  • 2013-05-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-30
  • 1970-01-01
  • 2016-11-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多