Formula guide · Google Sheets · Updated May 13, 2026

Google Sheets QUERY Limit

Limit the number of rows returned by a Google Sheets QUERY formula.

Quick Answer

Add limit followed by the number of rows you want at the end of the QUERY string.

Copyable Formula

=QUERY(A1:D100,"select A, D where C = 'Paid' order by D desc limit 10",1)

Syntax

=QUERY(A1:D100,"select A, D order by D desc limit 10",1)

Google Sheets

Worked Example

ClausePurpose
order by D descsort largest first
limit 10return ten rows

Result: Returns only the first ten rows after filtering and sorting.

Steps

  • Build the QUERY without limit first.
  • Add order by if top rows depend on sorting.
  • Add limit at the end of the query string.
  • Change the number to control output size.

Common Mistakes

  • Using limit before order by.
  • Limiting unsorted data and getting arbitrary-looking rows.
  • Forgetting that headers do not count as data rows.

Excel vs Google Sheets Notes

This page is focused on Google Sheets. Excel may require a different function, pivot table, or Power Query workflow.

Editorial check: This guide was last updated May 13, 2026. Formula behavior can vary by Excel version, Google Sheets rollout, and spreadsheet locale.

FAQ