且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-01-17 18:27:37

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