Search code examples
arraysgoogle-sheetsdynamicpivot-tablegoogle-sheets-query

Google sheet dynamic value pivot table


I'm trying to get a pivot table, where I can select the values from something like a slicer.

I found out that using GETPIVOTDATA can get the trick with a dropdown list, but not very usefull since it's only 1 cell.


Solution

  • try:

    =QUERY({A2:A8, INDIRECT(
     ADDRESS(2, MATCH(D10, 1:1, 0))&":"&
     ADDRESS(8, MATCH(D10, 1:1, 0)))}, 
     "select Col1,sum(Col2) 
      where Col1 is not null 
      group by Col1
      label sum(Col2)''", 0)
    

    0