xplode data in google sheet

32 Views Asked by At

I got a table like this

enter image description here

Category is a multiple selection, the count simply is the number of occurrences. I want to tranform to this table

enter image description here.

In python, i can use xplode function. But u want using formular or appscript in googlesheets to solve this problem. I try arrayformular, and split. But it's not worked

1

There are 1 best solutions below

1
z.. On BEST ANSWER

Here's a possible solution:

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

enter image description here