根据谷歌表格中 2 列公式的 ID 组合行

时间:2021-04-09 18:35:24

标签: google-sheets google-sheets-formula transpose

我有这样的数据:

input

我希望它看起来像这样:

output

公式的想法? 谢谢! 玛丽亚

1 个答案:

答案 0 :(得分:1)

试试:

=ARRAYFORMULA(TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY(QUERY({A2:A&"×"&B2:B, 
 TRIM(FLATTEN(QUERY(TRANSPOSE({"×"&C2:D}),,9^9))), 
 TRIM(FLATTEN(QUERY(TRANSPOSE(C2:D),,9^9)))}, 
 "select Col1, max(Col2) where Col3 is not null group by Col1 pivot Col3"), 
 "offset 1", 0)),, 9^9)), "×")))

enter image description here