Search code examples
google-sheetsgoogle-apps-scriptmultipleselection

Counting occurrences of Value in Multiple Selection with GoogleSheets


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

enter image description here

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?


Solution

  • You can use the QUERY function. Assuming your data is in A2:A6, the formula would be:

    =ARRAYFORMULA(
       QUERY(
         TOCOL(SPLIT(A2:A6,", "),3),
         "select Col1, count(Col1)
          group by Col1
          label count(Col1) ''"))
    

    enter image description here

    This formula also accepts open ranges, like A2:A.