QUERY (Google Sheets)
Run SQL-like queries over a range in Google Sheets to filter, sort, and aggregate.
QUERY is a Google Sheets superpower: filter, group, and sort data with a SQL-style string. There is no direct Excel equivalent — FormulaCraft suggests SUMIFS/FILTER instead when you target Excel.
Excel
=SUMIFS(C:C, A:A, "Sales")Google Sheets
=QUERY(A:C, "select A, sum(C) where B = 'Sales' group by A", 1)How it works
- 1A:C is the data range.
- 2The query string filters where B = Sales and sums C grouped by A.
- 31 tells QUERY there is one header row.
Need a version for your data?
Try: “In Google Sheets, sum column C grouped by A where B is Sales using QUERY”