Google Sheets – Filter Pivot Table by Multiple Values

formulasgoogle sheetsgoogle-sheets-arrayspivot table

I have a pivot table below that I am trying to filter dynamically based on a separate list and am trying to figure out how to do this by referencing the relevant field. In the below example I have the same data set and I would like to filter column B (referral) by G3:G4 (12.com and ab.com). Ideally, the final result would be the pivot table would display everything aside from "xyz.com" found under rt.com

In the pivot table editor I've tried to choose filter -> referral -> filter by condition by a few different ways including:

=regexmatch(B3,"12.com|ab.com")
=MATCH("ab",B3,1)=1

If I run the above formulas outside the pivot table's filter it works fine, but inside nothing seems to work, even replacing B3 with B:B

If anyone has any advice on how to get this to work I would be highly appreciative.

enter image description here

Best Answer

  • use this formula to filter out stuff you need and then construct pivot table from there:

    ={E829:H829; FILTER(E830:H837, COUNTIF(B830:B837, G830:G837))}

0