gpt4 book ai didi

regex - 如何在 Google 表格中合并具有相同 ID 的行?

转载 作者:行者123 更新时间:2023-12-04 15:44:27 28 4
gpt4 key购买 nike

我正在尝试合并 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 表格本身是否有使用其原生功能自动执行此操作的方法?

最佳答案

=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))

0

关于regex - 如何在 Google 表格中合并具有相同 ID 的行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56469837/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com