Skip to content

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.

A1=SEQUENCE(4,5)
ABCDE
112345
2678910
31112131415
41617181920
One formula in A1 fills A1:E4. The numbers go across each row first.

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.

A2=SEQUENCE(COUNTA(B2:B100))
AB
1No.Task
21Order supplies
32Book venue
43Send invites
54Hire caterer
65Plan menu
76Print badges
87Set up room
98Send thank-yous
COUNTA(B2:B100) is 8, so SEQUENCE spills 1 to 8. With =SEQUENCE(ROWS(B2:B9)) the count is fixed at 8 instead.

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.

A2=SEQUENCE(7,1,DATE(2026,11,23))
AB
1WeekMonth
2Mon 11/23January
3Tue 11/24February
4Wed 11/25March
5Thu 11/26April
6Fri 11/27May
7Sat 11/28June
8Sun 11/29July
Column A is formatted ddd m/d. Column B is =DATE(2026,SEQUENCE(12),1) formatted mmmm; it carries on to December in B13.

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.

A2=SEQUENCE(6,7,DATE(2026,12,1)-WEEKDAY(DATE(2026,12,1))+1)
ABCDEFG
1SunMonTueWedThuFriSat
2293012345
36789101112
413141516171819
520212223242526
6272829303112
73456789
December 2026. To grey out the November and January days, add a conditional-formatting rule that checks whether MONTH(A2) is not 12.

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).

A2=SEQUENCE(10,1,10,-1)
A
1Countdown
210
39
48
57
66
75
84
93
102
111
Start 10, step -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 COUNTA on 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()-1 copied 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

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.