← Functions
sequencemathfunctionsintermediate

Excel SEQUENCE Function

SEQUENCE generates a list of sequential numbers across rows, columns, or both, in a single spilling formula.

SEQUENCE generates a list of sequential numbers and spills them automatically into the cells around the formula. It returns an array, so one formula in one cell can fill 500 rows, 12 columns, or a full grid, without copying a formula down or dragging a fill handle. The default arguments are safe, but the function still throws errors if you feed it text, zero, or a range too small to hold the result.

Available in: Excel 365, Excel 2021. Not available in Excel 2019 or earlier.

Syntax

=SEQUENCE(rows, [columns], [start], [step])
ParameterRequiredDescription
rowsYesHow many rows the array spills into. Must be a positive whole number.
columnsNoHow many columns the array spills into. Defaults to 1, producing a single column.
startNoThe first number in the sequence. Defaults to 1. Can be negative, zero, or a date serial number.
stepNoHow much each number increases (or decreases) from the previous one. Defaults to 1. Use a negative value to count down.

SEQUENCE needs enough empty cells below and to the right of the formula to hold every value it generates. If those cells contain anything else, even a single space character, the formula throws #SPILL! instead of returning results.

Basic Example

You're building an invoice tracker and need to number 25 rows starting at invoice 1001.

=SEQUENCE(25, 1, 1001, 1)

// 25   = number of rows to generate
// 1    = single column
// 1001 = first invoice number
// 1    = increment by 1 each row

This spills 25 numbers down a single column: 1001, 1002, 1003, and so on through 1025. Change 25 to 50 and the formula automatically extends to fill 50 rows. No copy-paste, no dragging.

How SEQUENCE Works

Rows and columns set the shape of the array

The first two arguments define a grid, not just a list. =SEQUENCE(4, 3) returns a 4-row, 3-column array numbered 1 through 12. Omit columns and you get a single column; set rows to 1 and columns to a larger number, and the sequence runs across a single row instead.

Start and step control the counting pattern

start sets the first value, step sets the gap between each number. =SEQUENCE(3, 1, 10, 5) returns {10;15;20} stacked in 3 rows. Change the shape to =SEQUENCE(1, 3, 10, 5) and the same three numbers, {10,15,20}, run across 3 columns instead. Same math, different layout.

Fill order goes across the row first, then down

For a two-dimensional array, SEQUENCE fills left to right across row one, then moves to row two. =SEQUENCE(3, 3) returns 1, 2, 3 in the first row, 4, 5, 6 in the second, and 7, 8, 9 in the third. This trips people up who expect it to fill column-first, like reading down before across.

Dates are just sequential numbers underneath

Excel stores dates as serial numbers counting from January 1, 1900, so SEQUENCE works on dates the same way it works on any integer. =SEQUENCE(5, 1, DATE(2026,10,1), 1) returns five sequential serial numbers starting at the number that represents October 1, 2026. Format the result as a date and it displays as October 1 through October 5, 2026, one day at a time.

Common Use Cases

Renumbering rows that survive sorting and filtering

Manually typed row numbers get scrambled the moment someone sorts the table. Reference the size of the data instead of hardcoding a row count.

=SEQUENCE(COUNTA(sales_reps))

// COUNTA(sales_reps) = counts filled rows in the range, so the sequence
// automatically grows or shrinks as reps are added or removed

Building chart category labels without typing them one by one

Concatenate SEQUENCE with text to generate axis labels on the fly.

="Q" & SEQUENCE(1, 8)   // returns Q1, Q2, Q3... Q8 across 8 columns

Splitting a large order list into fixed-size batches

Assign a batch number to 500 rows in groups of 50 without a helper formula copied 500 times.

=ROUNDUP(SEQUENCE(500)/50, 0)

// SEQUENCE(500) = numbers 1 through 500
// /50           = divides into batches of 50 rows each
// ROUNDUP(...,0) = rounds each result up to the nearest whole batch number

Creating a countdown for a project timeline

A negative step reverses the direction of the sequence.

=SEQUENCE(10, 1, 10, -1)   // returns 10, 9, 8... down to 1

Handling Errors

SEQUENCE throws two errors regularly: #VALUE! and #SPILL!. They have different causes and need different fixes.

Common causes of #VALUE!:

  • rows or columns is zero, negative, or a decimal instead of a positive whole number
  • start or step contains text instead of a number
  • Any argument references a blank or non-numeric cell

Common causes of #SPILL!:

  • Not enough empty cells below or to the right of the formula
  • A merged cell sitting inside the spill range
  • The formula is placed inside an Excel Table, which blocks spilling by default

IFERROR only helps with the #VALUE! case, where B2 might hold text or a bad reference:

=IFERROR(SEQUENCE(B2, 1, 1, 1), "Check the rows argument in B2")

Don't wrap SEQUENCE in IFERROR expecting it to fix a #SPILL! error. IFERROR can catch the error and display a fallback message, but the array still can't spill until you clear the blocking cell or move the formula to open space. Fix the space problem first.

Notes & Gotchas

What does the SEQUENCE function do in Excel?

SEQUENCE generates a list of sequential numbers in an array, such as 1, 2, 3, 4, and spills the result into the cells around the formula. It works for simple counting lists, custom step patterns, and date series, all from a single formula.

How do you use the SEQUENCE function with rows, columns, start, and step arguments?

Rows and columns set the shape, start sets the first number, and step sets the gap between values. =SEQUENCE(4, 1, 100, 25) returns {100;125;150;175} stacked in 4 rows, useful for building a quick set of threshold tiers without typing each one by hand. Swap columns from 1 to 4 in the same formula and the same four numbers run across a single row instead of stacking down a column.

How do you create a simple numbered list from 1 to n using SEQUENCE?

Use SEQUENCE with just the rows argument: =SEQUENCE(n) where n is however many numbers you need. Every other argument defaults to 1, so =SEQUENCE(10) returns 1 through 10 down a single column with no extra setup.

Why does SEQUENCE give a #SPILL! error, and how do you fix it?

#SPILL! means Excel found something in the way of the array's landing zone, usually leftover data, a merged cell, or an Excel Table boundary. Clear or move whatever is blocking the range below and to the right of the formula, and the array spills as soon as the path is open.

Can SEQUENCE be used to generate a list of sequential dates?

Yes. Since Excel stores dates as serial numbers, SEQUENCE can step through them like any other integer, not just one day at a time. =SEQUENCE(6, 1, DATE(2026,1,5), 7) returns six weekly dates starting January 5, 2026, stepping 7 days apart, useful for laying out a list of recurring Monday meeting dates. Format the output cells as dates and the numbers display as calendar dates instead of serial numbers.

Why can't I edit just one cell inside a SEQUENCE result?

A spilled array behaves as a single object; only the top-left cell holds the actual formula. Try to edit or delete a cell in the middle of the range and Excel blocks the change until you edit the anchor cell instead.

Does SEQUENCE work inside an Excel Table?

Not cleanly. Tables expand and contract based on their own rules, which conflicts with how a spilled array claims its range, so SEQUENCE inside a Table often throws #SPILL! even with plenty of empty rows below. Place SEQUENCE outside the Table and reference the Table's row count instead, using =SEQUENCE(ROWS(orders_table)).

Related Functions

FunctionUse this when...
FILTERYou want to pull matching rows from a range dynamically, often paired with SEQUENCE for numbered results.
UNIQUEYou need a distinct list from a range before numbering or ranking it with SEQUENCE.