How to Use the SEQUENCE Function in Google Sheets
=SEQUENCE(rows, [columns], [start], [step]). =SEQUENCE(5) returns 1 to 5 down a column.
What SEQUENCE does
Numbering rows by hand or by dragging a fill handle breaks when rows move. SEQUENCE builds the list from one formula. It is useful for row numbers, test data and the number inputs of other array formulas.
SEQUENCE syntax
=SEQUENCE(rows, [columns], [start], [step])
| Argument | Meaning | Default |
|---|---|---|
rows | Number of rows to return (required) | None |
columns | Number of columns to return | One column |
start | The number the sequence begins at | 1 |
step | How much each number increases or decreases | Increases by 1 |
If you leave out columns the result is a vertical list. For a horizontal list, set rows to 1 and give a column count. A negative step produces a decreasing sequence.
A step-by-step example
=SEQUENCE(5)
This returns 1, 2, 3, 4, 5 down a column. For a grid, add columns: =SEQUENCE(2, 3) returns 1, 2, 3 on the first row and 4, 5, 6 on the second. Numbers fill row by row.
=SEQUENCE(2, 3, 10, -1)
This starts at 10 and steps down by 1, giving 10, 9, 8 on the first row and 7, 6, 5 on the second.
Common mistakes
- Blocked output cells. The result spills into the cells below and to the right, which must be empty.
- Mixing up rows and columns. The first argument is rows.
- Expecting a horizontal list by default. Set rows to 1 and use columns, or transpose the result.
Try it yourself
Type your formula into the box, starting with =, then press Check.
Exercise 1: Five numbers
Write a formula that returns a list of the numbers 1 to 5 down a column.
Exercise 2: Counting down
Write a formula that returns a grid of 2 rows and 3 columns, starting at 10 and decreasing by 1.
What to learn next
- TRANSPOSE: swap rows and columns.
- FLATTEN: turn many columns into one.
- ARRAYFORMULA: run one formula down a whole column.
Syntax and rules in this guide were checked against Google's SEQUENCE help page. See all guides.