Home > Back-end >  Google Sheets - How to sum columns in a query formula based off different drop down filters
Google Sheets - How to sum columns in a query formula based off different drop down filters

Time:07-20

I'm brand new to google sheets and have been trying for a couple days to get this to work. I currently am using a query to pull my data from the school data tab then using drop down menus to look at the data by school and in between a window of dates. I'm trying to get it so when I change the window of dates of the school that and will produce a sum of that column at the bottom of each column for the dates and school i have selected that will change with whatever I have picked in the drop downs. Following different tutorials keeps giving me the same problem, that being when I add the sum query it will add up the whole column and doesn't change based on the school selected. Would really appreciate any help

enter image description here


Summing all the columns in the query:

={query('School Data'!A1:AL999,"SELECT V, SUM(C), SUM(D), SUM(E), SUM(F), SUM(G), SUM(H), SUM(I), SUM(J), SUM(K), SUM(L), SUM(M), SUM(N), SUM(O), SUM(P), SUM(Q), SUM(R) 
where V is not null 
AND V >= date """&text(C6,"yyyy-mm-dd")&""" 
AND V <= date """&text(C7,"yyyy-mm-dd")&""" 
AND A ="""&F6&"""GROUP BY V 
LABEL SUM(C) 'Total # of Phone Contacts Attempted'");"Total",query('School Data'!A1:AL999,"SELECT SUM(C), SUM(D), SUM(E), SUM(F), SUM(G), SUM(H), SUM(I), SUM(J), SUM(K), SUM(L), SUM(M), SUM(N), SUM(O), SUM(P), SUM(Q), SUM(R) 
where V is not null 
AND V >= date """&text(C6,"yyyy-mm-dd")&""" 
AND V <= date """&text(C7,"yyyy-mm-dd")&""" 
AND A ="""&F6&""" 
LABEL SUM(C) '', SUM(D) '',SUM(E) '',SUM(F) '',SUM(G) '',SUM(H) '',SUM(I) '',SUM(J) '',SUM(K) '',SUM(L) '',SUM(M) '',SUM(N) '',SUM(O) '',SUM(P) '',SUM(Q) '',SUM(R) ''")}

ex2

  • Related