Google Sheets – Custom Formula for Pivot Table Filters

formulasgoogle sheetsgoogle-sheets-querypivot table

In my pivot table, I want to only display the entries in the column "Which Event" if the name contains "Baseball" or "Softball".

I can very easily do part of this by adding a filter for the field "Which Event" then set Text Contains > Softball.

But I cannot figure out the custom formula to do this for Softball or Baseball.

Best Answer

  • instead of your pivot table use QUERY:

={QUERY(Master!A:A, 
 "select A,count(A) 
  where A contains 'Softball' 
     or A contains 'Baseball' 
  group by A 
  label count(A)'Number of Signups'", 1);
 "Grand Total", 
 SUM(QUERY(Master!A2:A, 
 "select count(A) 
  where A contains 'Softball' 
     or A contains 'Baseball' 
  group by A 
  label count(A) ''", 0))}

enter image description here