What is the SEQUENCE function?
=SEQUENCE(rows, [columns], [start], [step])SEQUENCE fills several cells at once with numbers that rise by a fixed step, like 1, 2, 3. Use it for numbering, building date lists, or making a counter array to feed other functions.
Numbers fill the first row left to right, then move down to the next row. Any omitted argument counts as 1. Per Microsoft documentation, it is available in Excel 2021 and later and Microsoft 365.
Arguments
- rows
- How many rows to fill.
- columns
- Optional. How many columns to fill. Omitted means 1.
- start
- Optional. The first number. Omitted means 1.
- step
- Optional. What to add for each next number. Negative counts down. Omitted means 1.
SEQUENCE examples
Example 1. 1 to 10
=SEQUENCE(10)Fills one column with 1 to 10.
Example 2. 4 rows by 5 columns
=SEQUENCE(4, 5)1 to 20, with 1–5 in the first row, 6–10 in the second, and so on.
Example 3. Start and step
=SEQUENCE(5, 1, 1001, 1000)Fills 1001, 2001, 3001, 4001, 5001.
Example 4. Count down
=SEQUENCE(5, 1, 5, -1)5, 4, 3, 2, 1.
Example 5. 7 days of dates
=SEQUENCE(7, 1, TODAY())Date serial numbers for the 7 days from today. Format the cells as dates to see them as dates.
Example 6. Numbers to fit a list
=SEQUENCE(COUNTA(B2:B9))Numbers 1, 2, 3… for as many values as column B has.
Common mistakes
Expecting it to fill down first
=SEQUENCE(3, 3) puts 1, 2, 3 across the first row, not down the first column. Wrap it in TRANSPOSE for the column order.
rows of 0
If rows or columns is 0, there is no array to make and you get #CALC!.
The spill range is blocked
If cells the result would spill into already hold values, you get #SPILL!.
FAQ
- How is it different from the fill handle?
- Numbers dragged with the fill handle are plain values. SEQUENCE is a formula, so if rows comes from a cell, the numbers grow or shrink with it.
- Can the step be a decimal?
- Yes. =SEQUENCE(5, 1, 0, 0.5) gives 0, 0.5, 1, 1.5, 2.