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 =SEQUENCE(5) returns 1; 2; 3; 4; 5
Returns a grid of sequential numbers, such as 1 to 12 or a run of weekly dates, from a single formula.
Syntax
=SEQUENCE(, , , )
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 =SEQUENCE(5) returns 1; 2; 3; 4; 5
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.
=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.
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.
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.
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.
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.
DATE(2025,1,6).Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
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 =SEQUENCE(5) returns 1; 2; 3; 4; 5
Example 2
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 =SEQUENCE(2,4) returns 1, 2, 3, 4; 5, 6, 7, 8
Example 3
A2 =SEQUENCE(5,1,100,-25)
Result: 100; 75; 50; 25; 0
Start at 100 and subtract 25 each row.
A2 =SEQUENCE(5,1,100,-25) returns 100; 75; 50; 25; 0
Example 4
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 =SEQUENCE(4,1,DATE(2025,1,6),7) returns 45663; 45670; 45677; 45684
Example 5
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 =SEQUENCE(3)*SEQUENCE(1,3) returns 1, 2, 3; 2, 4, 6; 3, 6, 9
Example 6
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 =TEXT(DATE(2025,SEQUENCE(1,6),1),"mmm") returns Jan, Feb, Mar, Apr, May, Jun
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.
#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.#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).TRANSPOSE(SEQUENCE(columns,rows)) or use WRAPCOLS.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.
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.
Use a negative step. `=SEQUENCE(10,1,10,-1)` returns 10 down to 1.
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.
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.
No. It is available in Microsoft 365, Excel 2021 and later, and Excel for the web. Earlier versions return `#NAME?`.
Tracks take you from the basics to modelling, one graded exercise at a time.