# How to get the top 3 rows by value in Excel

Sort the table by the value column, largest first, and take the first rows: =TAKE(SORT(table,2,-1),3). In Google Sheets use QUERY with limit.

**Excel:** `=TAKE(SORT(A2:B8,2,-1),3)` (Excel 2024 and Microsoft 365)

**Google Sheets:** `=QUERY(A2:B8,"select A, B order by B desc limit 3",0)`

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Store | Q3 sales |  | Top 3 |
| Austin | 48200 |  |  |
| Boston | 61750 |  |  |
| Chicago | 57300 |  |  |
| Denver | 39800 |  |  |
| Miami | 66400 |  |  |
| Portland | 44150 |  |  |
| Seattle | 59900 |  |  |

Formula in D2: `=TAKE(SORT(A2:B8,2,-1),3)`

Result (spills 3 × 2): Miami, $66,400; Boston, $61,750; Seattle, $59,900

## How it works

SORT orders the whole table by sales, highest first, and TAKE keeps the first 3 rows. In Google Sheets, QUERY does it in one step: `order by B desc limit 3`.

## Other ways

- `=FILTER(A2:B8,B2:B8>=LARGE(B2:B8,3))`: Keeps the rows at or above the third-largest value. Rows stay in their original order, and ties can return more than 3. (Original order: Boston, Miami, Seattle.)

## Common mistakes

- TAKE needs Excel 2024 or Microsoft 365. In Excel 2021 use `=INDEX(SORT(A2:B8,2,-1),SEQUENCE(3),{1,2})`.
- Ties at the cut-off are broken by the original order; decide whether that's fair for your list.

## Questions

**How do I get the bottom 3?**

Sort ascending: `=TAKE(SORT(A2:B8,2,1),3)`.

**How do I make N a cell?**

Replace 3 with the cell: `=TAKE(SORT(A2:B8,2,-1),F1)`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-29.

Source: https://spreadsheetpractice.com/formulas/top-n-rows
