FILTER vs QUERY in Google Sheets — Which One for Which Job (2026)
Home› FILTER vs QUERY in Google Sheets
Google Sheets Comparison

FILTER vs QUERY in Google Sheets

Both extract subsets of data. Both can filter by multiple conditions. Both return live ranges. But FILTER is a straightforward Sheets function with boolean conditions; QUERY is a SQL-like powerhouse that does filtering plus aggregation, grouping, sorting, and column reshaping. Choosing between them isn't about capability — it's about which set of features you actually need for the job.

⚡ Quick Answer

Use FILTER when you just need to return rows matching conditions — it's simpler, faster, and easier to read. Use QUERY when you need to aggregate (SUM, AVG, COUNT), group by categories, sort, or select specific columns — QUERY handles all of that in one formula. FILTER for row selection; QUERY for row selection PLUS transformation.

The fundamental difference

FILTER is a row-selector. Given a range and one or more boolean conditions, it returns the rows where all conditions are TRUE. That's it. The output has the same columns as the input, just fewer rows.

QUERY is a mini-database engine. Given a range and a SQL-like query string, it can select specific columns, filter rows, aggregate values, group by categories, sort results, and label the output columns — all in a single formula. The output can be a completely different shape than the input.

If FILTER is a pair of scissors — one job, does it well — QUERY is a Swiss Army knife with a data-transformation blade.

What FILTER does well

=FILTER(range, condition1, [condition2], ...)

Each condition is a boolean array the same size as the range's rows. The formula returns only rows where every condition evaluates TRUE.

Simple filter

=FILTER(Sales!A:E, Sales!C:C = "North")

Return all Sales rows where column C equals "North". The output has all five columns; only the North rows appear.

Multiple conditions (AND)

=FILTER(Sales!A:E,
        Sales!C:C = "North",
        Sales!E:E > 500)

North region AND amount over 500. Every condition must be true for a row to be included.

OR logic — with +

=FILTER(Sales!A:E,
        (Sales!C:C = "North") + (Sales!C:C = "East"))

The + operator between two boolean conditions creates OR logic. This is a Sheets idiom — it exploits the fact that TRUE + FALSE = 1 (truthy) and FALSE + FALSE = 0 (falsy).

Filter strengths

  • Simple syntax — no SQL knowledge needed
  • Fast on modest datasets
  • Easy to read at a glance
  • Boolean conditions match standard formula thinking
  • Works well as a building block inside other formulas

What QUERY does well

=QUERY(range, "sql_string", [headers])

The query string uses Google Visualization API Query Language — a SQL subset. See the QUERY complete guide for full syntax reference.

Select specific columns

=QUERY(Sales!A:E, "SELECT A, C, E WHERE C = 'North'", 1)

Only return three columns from the source data. FILTER returns everything; QUERY lets you choose.

Aggregate

=QUERY(Sales!A:E, "SELECT C, SUM(E) GROUP BY C", 1)

Sum column E, grouped by region in column C. One formula produces a summary table. FILTER can't do this — you'd need to combine FILTER with SUM in helper cells.

Sort

=QUERY(Sales!A:E,
       "SELECT * WHERE C = 'North' ORDER BY E DESC", 1)

Filter to North, then sort by amount descending. FILTER would require wrapping the FILTER output in SORT — QUERY handles it inline.

Complex boolean logic

=QUERY(Sales!A:E,
       "SELECT * WHERE (C = 'North' OR C = 'East')
                  AND D LIKE '%Widget%'
                  AND E > 500", 1)

Mixed OR and AND with a wildcard match. FILTER can do this too, but the syntax gets awkward — QUERY reads more naturally.

Label output columns

=QUERY(Sales!A:E,
       "SELECT C, SUM(E)
        GROUP BY C
        LABEL SUM(E) 'Total Sales'", 1)

Rename the aggregated column. FILTER can't rename columns at all — you'd add headers manually.

QUERY strengths

  • Aggregation (SUM, AVG, COUNT, MAX, MIN)
  • Grouping by categories
  • Sorting inline
  • Column selection and renaming
  • Complex boolean logic reads cleanly
  • Everything in one formula — no chaining needed

Side-by-side comparison

AspectFILTERQUERY
TypeFunction with boolean conditionsFunction with SQL-like language
Learning curveGentle — matches formula thinkingSteeper — requires SQL basics
Row filteringYesYes
Column selectionNo (returns all columns)Yes (SELECT clause)
Aggregation (SUM, AVG, etc.)No (wrap with SUM etc.)Yes (native)
GroupingNoYes (GROUP BY)
SortingNo (wrap with SORT)Yes (ORDER BY)
Column renamingNoYes (LABEL clause)
Computed output columnsVery limitedYes (expressions in SELECT)
Wildcards / LIKERequires REGEX helpersNative LIKE with % and _
Case sensitivityCase-sensitive by defaultCase-sensitive (WHERE A = 'north' won't match 'North')
Speed on filteringFast for pure row selectionComparable, sometimes faster for complex ops
Available in ExcelYes (2019+/M365)No (Sheets exclusive)
Best forRow selection, simple filtersFiltering + aggregation + reshaping

Same problem, both approaches

Simple: return all North region rows

FILTER — cleaner
=FILTER(Sales!A:E,
        Sales!C:C = "North")

Direct and readable.

QUERY — overkill
=QUERY(Sales!A:E,
       "SELECT * WHERE C = 'North'", 1)

Works but heavier than needed.

Winner: FILTER. For pure row selection, FILTER is the more elegant tool.

Add aggregation: total sales by region

FILTER — awkward
=SUMIFS(Sales!E:E,
        Sales!C:C, "North")
=SUMIFS(Sales!E:E,
        Sales!C:C, "South")
=SUMIFS(Sales!E:E,
        Sales!C:C, "East")

Multiple formulas needed. FILTER doesn't aggregate.

QUERY — clean
=QUERY(Sales!A:E,
       "SELECT C, SUM(E)
        GROUP BY C", 1)

One formula, full breakdown.

Winner: QUERY. Aggregation is QUERY's home field.

Complex filter with sort

FILTER + SORT
=SORT(
  FILTER(Sales!A:E,
         Sales!C:C = "North",
         Sales!E:E > 500),
  5, FALSE)

Chained — works but harder to read.

QUERY
=QUERY(Sales!A:E,
  "SELECT *
   WHERE C = 'North' AND E > 500
   ORDER BY E DESC", 1)

Inline sort, natural reading order.

Winner: QUERY by a hair. FILTER + SORT works, but QUERY is easier to modify.

OR logic across values

FILTER — quirky
=FILTER(Sales!A:E,
  (Sales!C:C = "North")
  + (Sales!C:C = "East"))

The + creates OR, but it's Sheets-specific idiom.

QUERY — natural
=QUERY(Sales!A:E,
  "SELECT *
   WHERE C = 'North'
      OR C = 'East'", 1)

Reads like English.

Winner: QUERY. OR logic is where FILTER's boolean-array syntax gets awkward.

Combining FILTER and QUERY

You don't have to pick one. Common composition patterns:

FILTER inside QUERY

=QUERY(FILTER(Sales!A:E, Sales!C:C = "North"),
       "SELECT Col1, SUM(Col5) GROUP BY Col1
        LABEL SUM(Col5) 'North Total'", 1)

FILTER narrows to North region first (fast), then QUERY aggregates on the smaller result. When FILTER's WHERE-equivalent is simpler to express than QUERY's, this pattern reads better.

QUERY inside FILTER

Less common because QUERY's output is already usable directly. But when you have a QUERY result and need further row filtering that's easier to express in FILTER's boolean syntax:

=FILTER(QUERY(Sales!A:E, "SELECT A, SUM(E) GROUP BY A", 1),
        {TRUE; some_condition_array})

Rare in practice — usually it's easier to add the extra condition to the QUERY WHERE clause.

Rule of thumb for composition

Use FILTER for the "narrow the rows" step and QUERY for the "transform the result" step. This mirrors what happens in SQL databases — a WHERE filter before aggregation is typically the most efficient path. In Sheets, the same intuition holds.

The verdict

🎯 Bottom line

FILTER is for row selection. Simple syntax, easy to read, fast. If your task is "give me the rows that match these conditions," FILTER is the tool.

QUERY is for row selection AND transformation. Aggregation, grouping, sorting, column reshaping — all in one formula. If your task involves any of those, QUERY is worth the SQL learning curve.

Learn both, master QUERY. FILTER covers everyday needs; QUERY unlocks the sophisticated dashboards. If you can only learn one deeply, make it QUERY — the ceiling is much higher and the syntax skills transfer to real SQL work.

Frequently asked questions

What's the difference between FILTER and QUERY in Google Sheets?

FILTER returns rows from a range where boolean conditions are true — no aggregation, no reshaping, just filtered rows. QUERY uses SQL-like syntax to filter, aggregate, group, sort, and reshape data. FILTER is simpler and faster for pure row filtering; QUERY is more powerful when you need to compute totals, group by categories, or transform column output.

Is FILTER or QUERY faster in Google Sheets?

For simple row filtering, FILTER is usually faster because it's a lighter-weight operation. For complex filters with multiple conditions, QUERY often matches or exceeds FILTER because its SQL engine optimizes query execution. On datasets under 10,000 rows, the difference is imperceptible. On larger datasets, FILTER wins for pure row selection; QUERY wins when the alternative would be FILTER plus additional aggregation formulas.

Can FILTER do aggregation like SUM or COUNT?

Not directly. FILTER returns rows; it doesn't aggregate. To get totals from filtered data, wrap FILTER with SUM, COUNTA, AVERAGE, etc.: =SUM(FILTER(D:D, A:A="North")). QUERY handles aggregation natively: =QUERY(A:D, "SELECT SUM(D) WHERE A='North'"). For multiple aggregations, QUERY is usually cleaner.

Can I use FILTER inside QUERY, or vice versa?

Yes to both, though the patterns differ. You can use FILTER as the source range for QUERY: =QUERY(FILTER(A:D, A:A="North"), "SELECT Col1, SUM(Col4) GROUP BY Col1"). You can use QUERY output as the source for FILTER, though it's less common. Combining them is useful when you need FILTER's simple syntax for the first pass and QUERY's aggregation for the second.

Which should beginners learn first, FILTER or QUERY?

FILTER, by a wide margin. FILTER's syntax matches how spreadsheets already work — you point at ranges and use boolean expressions. QUERY requires learning a SQL-like dialect that's unfamiliar to non-programmers. Master FILTER first for row selection, then learn QUERY when you need aggregation or grouping that FILTER can't provide.