Excel function

SEQUENCEfunction

Fills several cells with numbers that rise by a fixed step, like 1, 2, 3.

Excel 2021+
=SEQUENCE(4, 3, 1, 1)
A
B
C
D
E
F
1
2
3
4
5
6

Leave columns blank to fill a single column. Enter -1 as the step to count down. The sheet shows up to 10 rows and 10 columns. Try breaking it on purpose to see the errors.

Result

{1,2,3;4,5,6;7,8,9;10,11,12}

rows

How many rows to fill.

columns

How many columns to fill. Omitted means 1.

start

The first number. Omitted means 1.

step

What to add for each next number. Omitted means 1.

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

  1. Example 1. 1 to 10

    =SEQUENCE(10)

    Fills one column with 1 to 10.

  2. 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.

  3. Example 3. Start and step

    =SEQUENCE(5, 1, 1001, 1000)

    Fills 1001, 2001, 3001, 4001, 5001.

  4. Example 4. Count down

    =SEQUENCE(5, 1, 5, -1)

    5, 4, 3, 2, 1.

  5. 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.

  6. 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

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.