在谷歌表格中xplode数据

问题描述 投票:0回答:1

我有一张这样的桌子

enter image description here

类别是多项选择,计数只是出现的次数。我想变身这张桌子

enter image description here

在Python中,我可以使用xplode函数。但你想在 googlesheets 中使用公式或 appscript 来解决这个问题。我尝试 arrayformular 和 split。但没成功

arrays google-sheets google-apps-script google-sheets-formula
1个回答
0
投票

这是一个可能的解决方案:

=ARRAYFORMULA(QUERY(SPLIT(TOCOL(SPLIT(A2:A4,",")&"|"&B2:B4),"|"),"where Col2 is not null"))

© www.soinside.com 2019 - 2024. All rights reserved.