How to Use LIMIT to Limit Rows using Query function

To use LIMIT to limit rows using the Query function in Google Sheets, you need to include the LIMIT keyword followed by the desired number of rows you want to display in your query. Here's how to do it:

  1. Start by opening a Google Sheet where you want to limit the number of rows displayed using the Query function.
  2. In an empty cell, type the following formula:
=QUERY(range, "SELECT * LIMIT n")

Replace range with the range of cells you want to query, and replace n with the number of rows you want to limit the results to.

For example, if you want to limit the results to the first 5 rows from a range A1:C10, you would input:

=QUERY(A1:C10, "SELECT * LIMIT 5")
  1. Press Enter to apply the formula.
  2. The Query function will now display only the first n rows from the specified range.

Example

Let's say we have a dataset in the range A1:C10, and we want to limit the rows to the top 5 rows using the Query function.

  1. In an empty cell, type the following formula:
=QUERY(A1:C10, "SELECT * LIMIT 5")
  1. Press Enter to apply the formula.
  2. The Query function will now display only the first 5 rows from the range A1:C10.
Did you find this useful?