I have a column, that contains multiple selection value like this

How to count occurrences of values in multiple selection with pivot table or gg sheets function?
I dont have any ideas for this problem. Can calculated by appscript?
I have a column, that contains multiple selection value like this

How to count occurrences of values in multiple selection with pivot table or gg sheets function?
I dont have any ideas for this problem. Can calculated by appscript?
On
You will need two formulas for this:
Extract unique values:
=sort(unique(flatten(map(B3:B5, lambda(v, if(isblank(v),, split(v, ", ")))))))
Here B3:B5 is the range of the data with multiple selection. It sorts the values alphabetically and assumes that the separator is a comma followed by a space: , .
Count number of occurrences of the list of separate values in the data:
=map(D3:D7, lambda(v, if(isblank(v),, counta(filter(B3:B5, regexmatch("^"&B3:B5&"$", v))))))
Here D3:D7 is the rage of the values we generated in step 1, and B3:B5 is the original data with multiple selection. The formula assumes that within one selection each value appears only once.
This is how it looks in a spreadsheet:
You can use the
QUERYfunction. Assuming your data is inA2:A6, the formula would be:This formula also accepts open ranges, like
A2:A.