QUERY

runs SQL-like query on data range · from google sheets · no excel equivalent · sheets: not yet compared

signature

QUERY(data, query, [headers])

returns: array

argumentrequired
data required
query required
headers optional

examples

formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.

RS
1 regionamount
2 north100
3 south200
4 north300
fx =QUERY(R1:S4, "select A, B where B > 150") south
fx =QUERY(R1:S4, "select A, B order by B desc limit 2") region

related

  • DECODEURL decodes URL-encoded text
  • ENCODEURL encodes text for use in URLs using percent encoding
  • FILTERXML selects values from an xml STRING with an xpath