• Skip to main content
  • Skip to primary sidebar

Excel Tips and Tricks

  • About
  • Privacy Policy

How to limit results returned by Query function in Google Spreadsheet

September 5, 2011 by Ravi Leave a Comment

We had already seen brief introduction about using Query function in Google Spreadsheet. Let us see how to limit the number of rows returned using Query Function with the following sample data of batsman with maximum runs in test cricket.

Now if you want to get the top 3 batsman with maximum number of runs scored, then you can use

=QUERY(C3:G13,”select C,G limit 3″)

The limit keyword will reduce the number of results returned to 3.

But say if you want to get the list of top 3 batsman with maximum averages then need to use the Order by clause.

=QUERY(C3:G13,”select C,F order by F desc limit 3″)

The above query would first sort the list using Order by clause and then uses the limit keyword to get the Top results.

Filed Under: Excel, Technical Tagged With: Google Spreadsheet, Limit, Order by, Query, results

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • How to increase number of worksheets Excel
  • A trick to flip a column upside down in Excel
  • Prevent users from adding new worksheet in Excel
  • Repeat action keyboard shortcut in Microsoft Office
  • How to import text file in Excel

Copyright 2020 © getexceltips.com