【问题标题】:How to combine rows with same ID in Google Sheets?如何在 Google 表格中合并具有相同 ID 的行?
【发布时间】:2019-06-06 01:17:13
【问题描述】:

我正在尝试在 Google 表格中合并具有相同 ID 的行

发件人:

ID     | Category
Augur  | A1
Augur  | A2
Augur  | A3
Augur1 | A1
Augur1 | A2
Augur1 | A3

收件人:

ID     | Category
Augur  | A1; A2; A3
Augur1 | A1; A2; A3

在 Google 表格本身中,是否有一种自动的方式来使用其原生功能?

【问题讨论】:

    标签: regex google-sheets google-sheets-formula array-formulas google-sheets-query


    【解决方案1】:
    =ARRAYFORMULA(QUERY({INDEX(QUERY(A1:B, 
     "select A,count(A) where A is not null group by A pivot B", 0), , 1),
     REGEXREPLACE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(IF(ISNUMBER(QUERY(A1:B, 
     "select count(A) where A is not null group by A pivot B", 0)), INDEX(QUERY({A1:A,B1:B&";"},
     "select count(Col1) where Col1 is not null group by Col1 pivot Col2 offset 1", 0), 1,), ))
     , , 999^99))), ";$", )}, "offset 1", 0))
    

    【讨论】:

    • 谢谢@player0,还有一个问题:有没有办法在“;”中使用换行符?
    猜你喜欢
    • 2020-12-23
    • 1970-01-01
    • 2021-11-02
    • 2019-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多