Skip to content
Google Sheets functionNot in Excel

QUERY function in Excel

Excel doesn't have QUERY — here's what does.

Excel has no QUERY. Modern Excel rebuilds it from composable dynamic-array functions: FILTER for the where clause, CHOOSECOLS for the select, SORT for the order by.

What QUERY does in Google Sheets

Runs a Google Visualization API Query Language query across data.

=QUERY(data, query, [headers])

Convert QUERY formulas to Excel

Before and after, formula by formula.

  1. A select + where + order by query:

    Google Sheets
    =QUERY(A1:D100, "select A, D where D > 1000 order by D desc", 1)
    Excel
    =SORT(CHOOSECOLS(FILTER(A2:D100, D2:D100 > 1000), 1, 4), 2, -1)

    Read it inside-out: FILTER is the where clause, CHOOSECOLS the select, SORT the order by.

  2. A group-by aggregation:

    Google Sheets
    =QUERY(A1:C100, "select A, sum(C) group by A", 1)
    Excel
    =GROUPBY(A2:A100, C2:C100, SUM)

    GROUPBY needs Microsoft 365. On Excel 2021, pair UNIQUE with SUMIF instead.

Worth knowing

  • QUERY's pivot clause has no formula one-liner in Excel — use PIVOTBY (Microsoft 365) or a PivotTable.

Converting more than one formula? The Excel ↔ Sheets translator rewrites whole workbooks and flags every QUERY so none slip through silently.

Browse Google Sheets google functions