Lesson 82 of 92 · Free Excel Course
Excel · Excel function reference
Excel SEQUENCE Function: Syntax, Examples and Common Errors
How the Excel SEQUENCE function spills a list or grid of numbers: numbered lists, months, dates, a calendar grid, countdowns, plus #SPILL! and #CALC! fixes.
The SEQUENCE function makes a list of numbers in one go. You say how many rows and columns you want, where to start and how much to add each time, and Excel fills the cells for you. The result is an array that spills: you type the formula in one cell and the numbers flow into the cells below and to the right. SEQUENCE is in Excel for Microsoft 365 (Windows and Mac), Excel for the web, Excel 2024 and Excel 2021, and the Excel apps for iPad, iPhone and Android. Excel 2019 and older don't have it.
Syntax
=SEQUENCE(rows, [columns], [start], [step])
- rows (required): how many rows to fill.
=SEQUENCE(5)gives 1 to 5 in a column. Microsoft notes you may leave it empty only if you give at least one other argument; it then counts as 1, so=SEQUENCE(,5)gives 1 to 5 across a row. - columns (optional, default 1): how many columns.
=SEQUENCE(1,5)gives 1 to 5 across a row. - start (optional, default 1): the first number. It can be a date, a decimal or a negative number.
- step (optional, default 1): what to add for each next value. A negative step counts down; 0 repeats the start value.
You can skip an optional argument by leaving its comma: =SEQUENCE(5,,10) gives 10 to 14. With more than one column, SEQUENCE fills across the first row, then the next row, like reading a page. Decimals in rows and columns are cut down to whole numbers.
Examples
Microsoft's examples. =SEQUENCE(4,5) fills 4 rows by 5 columns with 1 to 20. Microsoft also uses =SEQUENCE(5,1,1001,1000) for a list of account codes: 1001, 2001, 3001, 4001 and 5001.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | 5 |
| 2 | 6 | 7 | 8 | 9 | 10 |
| 3 | 11 | 12 | 13 | 14 | 15 |
| 4 | 16 | 17 | 18 | 19 | 20 |
A list that numbers itself. Instead of dragging numbers down a to-do list, let COUNTA count the tasks. Add a task in B10 and a 9 appears.
| A | B | |
|---|---|---|
| 1 | No. | Task |
| 2 | 1 | Order supplies |
| 3 | 2 | Book venue |
| 4 | 3 | Send invites |
| 5 | 4 | Hire caterer |
| 6 | 5 | Plan menu |
| 7 | 6 | Print badges |
| 8 | 7 | Set up room |
| 9 | 8 | Send thank-yous |
Months and dates. =SEQUENCE(12) gives the month numbers 1 to 12. To show names, feed them to DATE and format the cells: =DATE(2026,SEQUENCE(12),1) with the custom number format mmmm shows January to December. For days, put a date as the start: =SEQUENCE(7,1,DATE(2026,11,23)) lists Monday 11/23/2026 to Sunday 11/29/2026. A step of 7 gives the same weekday every week.
| A | B | |
|---|---|---|
| 1 | Week | Month |
| 2 | Mon 11/23 | January |
| 3 | Tue 11/24 | February |
| 4 | Wed 11/25 | March |
| 5 | Thu 11/26 | April |
| 6 | Fri 11/27 | May |
| 7 | Sat 11/28 | June |
| 8 | Sun 11/29 | July |
A month calendar grid. Six rows by seven columns covers any month. Start on the Sunday before the 1st: DATE(2026,12,1)-WEEKDAY(DATE(2026,12,1))+1 is Sunday 11/29/2026. Format the grid with the custom format d so only the day number shows.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 2 | 29 | 30 | 1 | 2 | 3 | 4 | 5 |
| 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 4 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 5 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 6 | 27 | 28 | 29 | 30 | 31 | 1 | 2 |
| 7 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Counting down. A negative step reverses the order: =SEQUENCE(10,1,10,-1) gives 10, 9, 8 … 1. Combine it with a count to number a list from the bottom up: =SEQUENCE(COUNTA(B2:B100),1,COUNTA(B2:B100),-1).
| A | |
|---|---|
| 1 | Countdown |
| 2 | 10 |
| 3 | 9 |
| 4 | 8 |
| 5 | 7 |
| 6 | 6 |
| 7 | 5 |
| 8 | 4 |
| 9 | 3 |
| 10 | 2 |
| 11 | 1 |
To shuffle numbers with no repeats (SEQUENCE plus RANDARRAY and SORTBY), see the random numbers lesson.
Common errors
- #SPILL! — the cells the result needs aren't empty, the spill would run off the edge of the sheet (
=SEQUENCE(1,17000)needs more than the 16,384 columns a sheet has), it hits merged cells, or the formula is inside an Excel table. Click the warning icon and choose Select Obstructing Cells, then clear them; move the formula out of a table. A size that changes on every recalculation, such as=SEQUENCE(RANDBETWEEN(1,1000)), also gives #SPILL!. - #CALC! — rows or columns is 0, so the result would be an empty array. This often happens with
COUNTAon an empty list. Wrap it:=IF(COUNTA(B2:B100)=0,"",SEQUENCE(COUNTA(B2:B100))). - #VALUE! — rows or columns is negative or text that isn't a number, or rows is larger than the sheet's 1,048,576 rows.
- #NAME? — your Excel doesn't have SEQUENCE (Excel 2019 or older). Use the fill handle, or
=ROW()-1copied down. - Numbers like 46349 instead of dates — the start was a date, but the cells have the General format. Press Ctrl+1 (Cmd+1 on a Mac) and pick a date format.
- #REF! — a formula that links to a spilled range in another workbook needs both workbooks open.
Related functions
- Random numbers in Excel uses SEQUENCE to shuffle lists and draw numbers without duplicates.
- WORKDAY function can turn a SEQUENCE into a list of working days.
- UNIQUE function is another spilling function, for lists without repeats.
- Dates and times explains date serial numbers and formats.
Try it yourself
Download the practice workbook. The Practice sheet has seven yellow cells, each for one spilling formula: a self-numbering task list, Microsoft's 4 x 5 grid, a week of dates, a countdown, months 1 to 12, the twelve month names with DATE, and a December 2026 calendar. Keep the cells around each yellow cell empty. The Answers sheet has every formula working. You need Excel 365, 2024, 2021 or Excel for the web.
Frequently asked questions
Which versions of Excel have the SEQUENCE function?
Excel for Microsoft 365 (Windows and Mac), Excel for the web, Excel 2024 and Excel 2021, plus the Excel apps for iPad, iPhone and Android. Excel 2019, 2016 and older don't have it and show #NAME? instead.
How do I number rows automatically with SEQUENCE?
Put =SEQUENCE(COUNTA(B2:B100)) in the first cell of the number column. COUNTA counts the filled cells in the list, so the numbers grow or shrink as you add or delete rows. It works as long as the list has no blank cells in the middle.
How do I make SEQUENCE count down?
Use a negative step. =SEQUENCE(10,1,10,-1) starts at 10 and goes down by 1 each row, ending at 1. To reverse any count, start at the count and step -1: =SEQUENCE(n,1,n,-1).
Can I use SEQUENCE to make a list of dates?
Yes. Dates are numbers in Excel, so give a date as the start: =SEQUENCE(7,1,DATE(2026,11,23)) lists seven days in a row from November 23, 2026. Use a step of 7 for weekly dates. If you see numbers like 46349, format the cells as dates.
Why does SEQUENCE give a #SPILL! error?
Something is in the cells the result needs to fill, or the formula is inside an Excel table. Click the error, choose Select Obstructing Cells, and clear or move what's there. Spilled formulas can't go in a table, so put the formula outside it or convert the table to a range.