Google Sheets QUERY Function

QUERY brings SQL-style power to Sheets — filter, sort, group, and aggregate in one formula. Here's how to use it.

Basic syntax

=QUERY(data, "SELECT A, B WHERE C > 100", 1)

Aggregate

Group and sum:
=QUERY(A:C, "SELECT A, SUM(C) GROUP BY A", 1)

⚡ Generate a formula — free, no signup

Describe what you want in plain English. Get the exact Google Sheets / Excel formula.