Skip to content

SEQUENCE

Returns a grid of sequential numbers, such as 1 to 12 or a run of weekly dates, from a single formula.

Syntax

=SEQUENCE(, , , )

Dynamic arrays

Excel for Microsoft 365, Excel 2021 and later, and Excel for the web. Not available in Excel 2019 or earlier.

Try it

Edit the formula in A2 or change the inputs. The sheet recalculates as you type.

A2
A
B
C
D
1
No.
2
1
3
2
4
3
5
4
6
5
7

A2 =SEQUENCE(5) returns 1; 2; 3; 4; 5

How SEQUENCE works

SEQUENCE builds a list or grid of evenly spaced numbers. Where you used to type 1 and 2 and drag the fill handle, you now type one formula and the whole run appears. Change the count and the run grows or shrinks.

The four arguments

  • rows is how many rows the result has.
  • columns is how many columns it has. Leave it out for a single column.
  • start is the first number, defaulting to 1.
  • step is the gap between numbers, defaulting to 1. A negative step counts down: =SEQUENCE(5,1,100,-25) returns 100, 75, 50, 25, 0.

When the grid has more than one column, SEQUENCE fills it across each row first, then moves to the next row. =SEQUENCE(2,4) gives 1 to 4 on the first row and 5 to 8 on the second.

How the result spills

SEQUENCE returns many cells from one formula. The formula sits in the cell you typed it in, and the rest of the numbers fill the cells below and to the right. That block is the spill range. If any cell in it is already occupied, Excel shows #SPILL! and fills none of it. Clear the blocking cell and the numbers appear. To use the whole block in another formula, write the anchor cell followed by #, for example =SUM(D2#). FILTER explains spill ranges in more detail.

Dates and other series

SEQUENCE has no date mode, but dates are numbers, so it works for them. =SEQUENCE(4,1,DATE(2025,1,6),7) returns four consecutive Mondays. Format the result as dates. Month labels work the same way: =TEXT(DATE(2025,SEQUENCE(1,6),1),"mmm") returns Jan to Jun across a row.

Why use it inside other formulas

SEQUENCE is often a helper for another function rather than a result you look at.

  • =INDEX(A2:A20,SEQUENCE(5,1,1,2)) returns every other item from the list.
  • =CHOOSEROWS(A2:C9,SEQUENCE(4,1,1,2)) takes rows 1, 3, 5 and 7 of a table.
  • =SEQUENCE(3)*SEQUENCE(1,3) multiplies a column of 1 to 3 by a row of 1 to 3 and returns a three-by-three times table.
  • =SEQUENCE(ROWS(A2:A20)) numbers every row of a list, however long it grows.

For a grid where each value depends on its row and column in a more complex way, use MAKEARRAY.

Limits

A rows or columns of 0 returns #CALC!. A negative number returns #VALUE!. The start and step can be decimals, but remember that binary decimals can show tiny rounding differences after many steps.

SEQUENCE needs Microsoft 365, Excel 2021 or later, or Excel for the web. In older versions use ROW and the fill handle.

Arguments

rows
How many rows to return. It must be at least 1.
columnsoptional
How many columns to return. The default is 1.
startoptional
The first number. The default is 1. It can be a date serial or a calculation such as DATE(2025,1,6).
stepoptional
The amount added each time. The default is 1. Use a negative number to count down.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

A numbered list: 1 to 5

A2 =SEQUENCE(5)

Result: 1; 2; 3; 4; 5

One argument gives one column. The formula is only in A2, and A2:A6 fills itself.

A2
A
B
C
D
1
No.
2
1
3
2
4
3
5
4
6
5
7

A2 =SEQUENCE(5) returns 1; 2; 3; 4; 5

Example 2

A grid: 2 rows by 4 columns

A1 =SEQUENCE(2,4)

Result: 1, 2, 3, 4; 5, 6, 7, 8

The numbers run across the first row, then continue on the second.

A1
A
B
C
D
E
1
1
2
3
4
2
5
6
7
8
3
4

A1 =SEQUENCE(2,4) returns 1, 2, 3, 4; 5, 6, 7, 8

Example 3

Count down with a negative step

A2 =SEQUENCE(5,1,100,-25)

Result: 100; 75; 50; 25; 0

Start at 100 and subtract 25 each row.

A2
A
B
C
1
Stock left
2
100
3
75
4
50
5
25
6
0
7

A2 =SEQUENCE(5,1,100,-25) returns 100; 75; 50; 25; 0

Example 4

Four weekly dates starting on a Monday

A2 =SEQUENCE(4,1,DATE(2025,1,6),7)

Result: 45663; 45670; 45677; 45684

DATE(2025,1,6) is a serial number, 45663. A step of 7 moves a week at a time. The cells show as dates because they are formatted that way; the values are the serial numbers.

A2
A
B
C
1
Week starting
2
06-Jan-2025
3
13-Jan-2025
4
20-Jan-2025
5
27-Jan-2025
6

A2 =SEQUENCE(4,1,DATE(2025,1,6),7) returns 45663; 45670; 45677; 45684

Example 5

A times table from two sequences

A1 =SEQUENCE(3)*SEQUENCE(1,3)

Result: 1, 2, 3; 2, 4, 6; 3, 6, 9

A column of 1 to 3 multiplied by a row of 1 to 3 gives a grid. Excel stretches each one across the other.

A1
A
B
C
D
E
1
1
2
3
2
2
4
6
3
3
6
9
4

A1 =SEQUENCE(3)*SEQUENCE(1,3) returns 1, 2, 3; 2, 4, 6; 3, 6, 9

Example 6

Month labels across a row

A1 =TEXT(DATE(2025,SEQUENCE(1,6),1),"mmm")

Result: Jan, Feb, Mar, Apr, May, Jun

SEQUENCE(1,6) supplies the month numbers 1 to 6. DATE turns each into the first of that month, and TEXT shows its short name.

A1
A
B
C
D
E
F
G
1
Jan
Feb
Mar
Apr
May
Jun
2
3

A1 =TEXT(DATE(2025,SEQUENCE(1,6),1),"mmm") returns Jan, Feb, Mar, Apr, May, Jun

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 3

In D1, list week numbers 1, 2, 3 and so on, as many as the number of weeks in B1.

Answer in D1.

D1
A
B
C
D
E
F
G
H
I
J
1
Weeks
6
2
Start date
06-Jan-2025
3
First number
100
4
Step
5
5
6
7
8

Common mistakes

  • #SPILL! means a cell in the result area is not empty. Clear it, or move the formula to a free area. The cells the result needs include everything below and to the right.
  • Zero rows or columns return #CALC!, and a negative count returns #VALUE!. If the count comes from a cell, make sure it can not be 0 or negative, for example with MAX(1,B1).
  • Dates come back as serial numbers such as 45663 until you format the result as dates. Select the spill range and apply a date format.
  • The grid fills across each row first, not down each column. For a column-first order, build the grid with TRANSPOSE(SEQUENCE(columns,rows)) or use WRAPCOLS.
  • You can not overwrite a single cell inside the spill. Edit the formula in the anchor cell, or the one you typed in, instead.

Questions people ask

How do I number rows automatically in Excel?

Use `=SEQUENCE(ROWS(B2:B20))` beside your list, or `=SEQUENCE(COUNTA(B2:B20))` to match the number of items. The numbers update when you add or remove rows from the range.

How do I create a list of dates with SEQUENCE?

Give a date as the start value and the gap in days as the step: `=SEQUENCE(12,1,DATE(2025,1,1),7)` returns twelve weekly dates. Format the cells as dates afterwards.

How do I make SEQUENCE count down?

Use a negative step. `=SEQUENCE(10,1,10,-1)` returns 10 down to 1.

Why does SEQUENCE show #SPILL!?

There is something in the cells where the numbers need to go. Clear the area below and beside the formula, or move the formula somewhere empty.

Can SEQUENCE fill down columns first?

Not directly, because it always fills across rows first. Swap the dimensions and transpose: `=TRANSPOSE(SEQUENCE(3,2))` returns 2 rows by 3 columns filled down each column.

Does SEQUENCE work in Excel 2019?

No. It is available in Microsoft 365, Excel 2021 and later, and Excel for the web. Earlier versions return `#NAME?`.

Learn SEQUENCE in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.