# SORTN, SEQUENCE and TRANSPOSE (Google Sheets lesson 16 of 17)

> Take the top rows, number a list, and flip a table on its side.

Source: https://spreadsheetpractice.com/google-sheets/learn/sortn-sequence-transpose · Updated October 29, 2026

- **Course:** [Google Sheets course](https://spreadsheetpractice.com/google-sheets), track "Sheets power tools"
- **Time:** about 9 minutes, 3 graded exercises
- **Functions:** `SORTN`, `SEQUENCE`, `TRANSPOSE`
- **Access:** Pro (the lesson text is free; the graded exercises need Pro)
- **Key formula:** `=SORTN(A2:B7,3,0,2,FALSE)`: The top 3 by column 2

## How it works

`SORTN(range, n, ties_mode, sort_column, ascending)` sorts a range and returns only its first `n` rows: a top-N list in one function. Use `ties_mode` 0 to return exactly n rows.

`SEQUENCE(rows, columns, start, step)` builds a list of numbers. `=SEQUENCE(5)` gives 1 to 5, handy as a rank column next to a top-N list.

`TRANSPOSE` turns rows into columns and columns into rows, so a vertical list becomes a header row.

## Syntax

| Formula | What it does |
|---|---|
| `=SORTN(A2:B7,3,0,2,FALSE)` | The top 3 by column 2 |
| `=SEQUENCE(3)` | 1, 2, 3 down a column |
| `=TRANSPOSE(A2:A7)` | A column turned into a row |

## Watch out for

- SORTN's ascending argument is TRUE or FALSE, not 1 or -1 like SORTBY.
- Leave room for the result to spill.
- ties_mode 0 returns exactly n rows even when there are ties at the cut-off.

## The exercises

Solve them in the live grid at [SORTN, SEQUENCE and TRANSPOSE](https://spreadsheetpractice.com/google-sheets/learn/sortn-sequence-transpose). Each answer is graded, then re-checked on changed data so typed-in numbers don't pass.

1. **Top three teams.** In D2, return the three teams with the most points from A2:B7, highest first, using SORTN. Return exactly three rows.
2. **Rank numbers.** In C2, use SEQUENCE to number the six teams 1 to 6 down the column.
3. **Teams across the top.** In D1, use TRANSPOSE to lay the team names in A2:A7 across a single row.

Previous: [MAP, BYROW and LAMBDA in Sheets](https://spreadsheetpractice.com/google-sheets/learn/map-lambda-byrow-sheets) · Next: [Capstone: a sales summary in Sheets](https://spreadsheetpractice.com/google-sheets/learn/capstone-sales-summary)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
