QUERY statements typically work with
C column names just fine.
=QUERY(A1:B326,"SELECT SUM(A) WHERE B = 'Active'")
SELECTs data from another tab in the same sheet with a
GROUP BY clause and column labels.
=QUERY(Sites!C2:C178,"SELECT C, COUNT( C ) WHERE C != '' GROUP BY C ORDER BY COUNT( C ) DESC label C 'Install', Count( C ) 'Count'")
QUERY requires column names
Col3 instead of
C when querying data from a different Sheet.
=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1KYK-Op3XKNElfwD0cz0SmBVA1y8NgnCr4bU2u6NJuN0/edit#gid=0", "Sheet2!A1:B326"),"SELECT SUM(Col1) WHERE Col2 = 'Active'")
I find it difficult to remember the letter O is the 15th letter of the English alphabet. There is no chance that I am going to memorize that column BH is the 60th.
Column name converter
Converts A to 1 and BH to 60
What’s going on in that second query?
QUERY can pull data from a Google Sheet at a different URL if a call to
IMPORTRANGE is passed into the first parameter of
Referencing tabs with spaces in their names
Use single quotes around a tab name that contains spaces, like ‘Raw Data’.
=QUERY('Raw Data'!A2:E700,"SELECT D,E,B WHERE A = 'received'",1)