=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.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Rows | Rows and columns | ||||
| 2 | 1 | 1 | 2 | 3 | 4 | |
| 3 | 2 | 5 | 6 | 7 | 8 | |
| 4 | 3 | 9 | 10 | 11 | 12 | |
| 5 | 4 | |||||
| 6 | 5 |
SEQUENCE syntax
=SEQUENCE(rows, [columns], [start], [step])
rowsis how many rows to return.columnsis how many columns. The default is 1.startis the first number. The default is 1.stepis 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:
| A | B | C | D | E | F | G | H | I | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 10 to 50 | 5 down to 1 | Across a row | ||||||
| 2 | 10 | 5 | 1 | 2 | 3 | 4 | 5 | ||
| 3 | 20 | 4 | |||||||
| 4 | 30 | 3 | |||||||
| 5 | 40 | 2 | |||||||
| 6 | 50 | 1 |
=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:
| A | B | |
|---|---|---|
| 1 | No. | Name |
| 2 | 1 | Ann |
| 3 | 2 | Ben |
| 4 | 3 | Cara |
| 5 | 4 | Dan |
| 6 | 5 | Eve |
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 | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Start | 2026-03-02 | Weekly | ||
| 2 | 2026-03-02 | Monday | 2026-03-02 | ||
| 3 | 2026-03-03 | Tuesday | 2026-03-09 | ||
| 4 | 2026-03-04 | Wednesday | 2026-03-16 | ||
| 5 | 2026-03-05 | Thursday | 2026-03-23 | ||
| 6 | 2026-03-06 | Friday | |||
| 7 | 2026-03-07 | Saturday | |||
| 8 | 2026-03-08 | Sunday |
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:
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 2 | 29 | 30 | 31 | 1 | 2 | 3 | 4 |
| 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 5 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 6 | 26 | 27 | 28 | 29 | 30 | 1 | 2 |
| 7 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
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
| A | B | |
|---|---|---|
| 1 | Start | 2026-05-04 |
| 2 | Dates |
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:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | List | Top 3 | Sum 1 to 10 | 1, 2, 3 repeated |
| 2 | Cara | Cara | 55 | 1 |
| 3 | Dan | Dan | 2 | |
| 4 | Ann | Ann | 3 | |
| 5 | Eve | 1 | ||
| 6 | Ben | 2 | ||
| 7 | 3 |
=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)+1repeats 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.