Menu

Excel SEQUENCE Function: Numbers, Dates and Calendars

=SEQUENCE(5) returns the numbers 1 to 5 down a column, and =SEQUENCE(3,4) fills 3 rows by 4 columns. Add a start and a step for any series, including dates, row numbers that grow with a list, and a monthly calendar.

Every sheet on this page is live: change a number or a formula and it recalculates.

=SEQUENCE(5) returns the numbers 1 to 5 down a column, from the one cell you type it in. With a second argument it fills a grid: =SEQUENCE(3,4) gives 3 rows and 4 columns, counting 1 to 12 across each row. Change the 5 in A2 to 8 and the column grows.

One column, then a grid
A2
ABCDEF
1RowsRows and columns
211234
325678
439101112
54
65
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

SEQUENCE syntax

=SEQUENCE(rows, [columns], [start], [step])
  • rows is how many rows to return.
  • columns is how many columns. The default is 1.
  • start is the first number. The default is 1.
  • step is how much each number adds to the one before. The default is 1, and it can be negative or a decimal.

A grid fills across first: in =SEQUENCE(3,4) the first row is 1, 2, 3, 4 and the second starts at 5. To count down the columns instead, wrap it in TRANSPOSE: =TRANSPOSE(SEQUENCE(4,3)).

SEQUENCE needs Excel 2021, Excel 2024 or Microsoft 365, and shows #NAME? in older versions. Google Sheets has the same function.

Start and step

The last two arguments set the first number and the gap between numbers:

Different starts and steps
A2
ABCDEFGHI
110 to 505 down to 1Across a row
210512345
3204
4303
5402
6501
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

=SEQUENCE(5,1,10,10) starts at 10 and adds 10 each time. =SEQUENCE(5,1,5,-1) counts down from 5. =SEQUENCE(1,5) is one row of five columns. For every other number, use a step of 2: =SEQUENCE(10,1,1,2) gives the odd numbers 1 to 19.

Number rows automatically

Row numbers typed by hand go out of date as soon as a row is added. Count the names instead and let SEQUENCE produce one number per name:

Numbers that follow the list
A2
AB
1No.Name
21Ann
32Ben
43Cara
54Dan
65Eve
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

COUNTA counts the 5 filled cells in B2:B8, so A2 returns 1 to 5. Type Finn in B7 and the numbers go to 6. COUNTA counts any filled cell, so the list must not have gaps; in a real sheet make the range generous, such as B2:B1000. If the list is empty, COUNTA returns 0 and SEQUENCE(0) shows #CALC!.

A sequence of dates

A date is a number in Excel (one per day), so a date works as the start. Each row below adds one day; the formula needs a date format, or it shows serial numbers such as 46083:

A week of dates from B1
B2
ABCDE
1Start2026-03-02Weekly
22026-03-02Monday2026-03-02
32026-03-03Tuesday2026-03-09
42026-03-04Wednesday2026-03-16
52026-03-05Thursday2026-03-23
62026-03-06Friday
72026-03-07Saturday
82026-03-08Sunday
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

B2 lists 2026-03-02 to 2026-03-08 and C2 names each day, Monday to Sunday. E2 uses a step of 7 for four dates a week apart. Change B1 and all three follow.

For months, a step of 30 drifts, because months have different lengths. Feed SEQUENCE into EDATE instead, which adds whole months: =EDATE(B1,SEQUENCE(6,1,0)) returns the 2nd of March to the 2nd of August (format the cells as dates). (See add days and months for EDATE and EOMONTH.)

A calendar grid with SEQUENCE

Six rows of seven days are enough for any month. The grid starts on the Sunday on or before the 1st: DATE(2026,4,1)-WEEKDAY(DATE(2026,4,1))+1 steps back from April 1 to that Sunday. The cells are formatted as d, so each shows its day number, and a conditional format highlights the days of April:

April 2026
A2
ABCDEFG
1SunMonTueWedThuFriSat
22930311234
3567891011
412131415161718
519202122232425
6262728293012
73456789
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

April 1, 2026 is a Wednesday, so the grid opens with 29, 30 and 31 from March. Change both 4s in A2 (and the 4 in the rule) to another month and the calendar redraws. To show blanks instead of the other month's days, test each date inside the formula; LET keeps that formula short.

Practice: dates a week apart

Your turn
B2
AB
1Start2026-05-04
2Dates
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Your turn: In B2, list 5 dates down the column, starting with the date in B1 and one week apart.

SEQUENCE inside other formulas

SEQUENCE is often a helper rather than the result. Three common uses:

SEQUENCE as a helper
B2
ABCD
1ListTop 3Sum 1 to 101, 2, 3 repeated
2CaraCara551
3DanDan2
4AnnAnn3
5Eve1
6Ben2
73
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.
  • =INDEX(A2:A6,SEQUENCE(3)) returns the first three items of a list: Cara, Dan and Ann. TAKE(A2:A6,3) does the same in Microsoft 365 and Excel 2024.
  • =SUM(SEQUENCE(10)) adds 1 to 10 without typing them: 55.
  • =MOD(SEQUENCE(6)-1,3)+1 repeats 1, 2, 3, 1, 2, 3, useful for assigning rows to three groups in turn.

A common mistake is putting SEQUENCE where its result cannot spill. =SEQUENCE(5) shows #SPILL! when any of the four cells below it holds data; clear them or move the formula (see #SPILL! error).

Frequently Asked Questions

What does the SEQUENCE function do in Excel?

It returns a list of numbers that spills from one cell: =SEQUENCE(5) gives 1 to 5 down a column, =SEQUENCE(1,5) gives 1 to 5 across a row, and =SEQUENCE(5,1,10,10) gives 10, 20, 30, 40, 50.

How do I create a sequence of dates in Excel?

Use a date as the start: =SEQUENCE(7,1,B1) returns seven consecutive days from the date in B1, and =SEQUENCE(4,1,B1,7) returns four dates a week apart. Format the result as a date, or it shows serial numbers.

How do I number rows automatically in Excel?

Put =SEQUENCE(COUNTA(B2:B100)) in the first row of the number column. It counts the filled cells in B and returns 1 up to that count, so a new name gets its number without copying anything.

How do I make a sequence that counts down?

Use a negative step: =SEQUENCE(5,1,5,-1) returns 5, 4, 3, 2, 1. The step can also be a decimal, as in =SEQUENCE(5,1,0,0.25).

Which Excel versions have SEQUENCE?

Excel 2021, Excel 2024 and Microsoft 365. Older versions show #NAME?; there you type the first two values and drag the fill handle, or use =ROW()-1 filled down.

Coddy programming languages illustration

Learn to code with Coddy

GET STARTED