The SEQUENCE function
Returns a list of numbers in sequence, such as 1, 2, 3, that spills into rows and columns. You choose the size, the start and the step.
Syntax
SEQUENCE(rows, [columns], [start], [step])- rows
- How many rows to fill.
- columns (optional)
- How many columns to fill. Left out, 1.
- start (optional)
- The first number. Left out, 1.
- step (optional)
- How much each number goes up by. Left out, 1. A negative step counts down.
Examples
B1=SEQUENCE(5)
| A | B | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | |
| 5 | 5 |
B1
=SEQUENCE(12,23,310,410)| A | B | C | D | |
|---|---|---|---|---|
| 1 | 10 | 20 | 30 | |
| 2 | 40 | 50 | 60 |
In plain words: Fill 12 rows and 23 columns, 3starting at 10 and 4counting up by 10.
B1=SUM(SEQUENCE(100))
| A | B | |
|---|---|---|
| 1 | 5050 |
Questions
How do I number a list that keeps growing?
Count the filled cells and let SEQUENCE spill that many numbers, as in =SEQUENCE(COUNTA(B2:B100)). Add a name to the list and the numbering grows with it.
Why does SEQUENCE return
The cells it needs are not empty. SEQUENCE(5) needs five free cells down from the formula; clear them and the numbers appear.