SEQUENCE generates an array of numbers in a grid, counting up or down by whatever step you choose. It is the building block for numbering rows, generating date lists, and creating index arrays that other functions consume, with no manual typing or drag-filling.
Syntax
=SEQUENCE(rows, [columns], [start], [step])
rows: How many rows to generate.columns[Optional]: How many columns. Default is1.start[Optional]: The first number. Default is1.step[Optional]: The increment between numbers. Default is1. It can be negative or decimal.
Numbers fill row by row from the top-left, and the result spills into the cells below and to the right.
Basic examples
=SEQUENCE(5)returns1, 2, 3, 4, 5down a column.=SEQUENCE(5, 1, 10, 5)returns10, 15, 20, 25, 30.=SEQUENCE(5, 1, 5, -1)counts down:5, 4, 3, 2, 1.=SEQUENCE(1, 5)returns1, 2, 3, 4, 5across a row.=SEQUENCE(3, 4)returns a grid, filled left to right then top to bottom:
1 2 3 4
5 6 7 8
9 10 11 12
Patterns that use SEQUENCE
Number rows automatically
Instead of dragging a counter, number as many rows as there are items:
=SEQUENCE(COUNTA(A2:A))
List of dates
Dates are numbers, so a sequence of dates is a sequence of numbers formatted as dates. Thirty consecutive days from today:
=SEQUENCE(30, 1, TODAY(), 1)
Format the cells as dates. For the first of every month in a year:
=ARRAYFORMULA(EDATE(DATE(2026, 1, 1), SEQUENCE(12, 1, 0, 1)))
Pick every n-th item
Use SEQUENCE to produce positions, and INDEX to pick them:
=INDEX(A2:A100, SEQUENCE(33, 1, 1, 3))
Returns items 1, 4, 7, ...
Build a multiplication table
=ARRAYFORMULA(SEQUENCE(9) * SEQUENCE(1, 9))
A column array times a row array produces a full 9x9 grid.
Repeat a pattern or label
=ARRAYFORMULA(IF(MOD(SEQUENCE(12), 2) = 0, "Even", "Odd"))
Shuffle a list of numbers
=SORT(SEQUENCE(100), RANDARRAY(100), TRUE)
Sorts the numbers 1 to 100 by random keys, which shuffles them. Each recalculation produces a new order.
Row and column indices
SEQUENCE(ROWS(A2:C10)) generates a counter that matches a table's height, which is the foundation of unpivoting, shuffling and ranking formulas.
Common errors
#REF!: Array result was not expanded. The destination cells are not empty. Clear them.#VALUE!.rowsorcolumnsis less than 1 or is not a number. For example,SEQUENCE(COUNTA(A2:A))fails when column A is empty, because the count is0. Guard it:=IF(COUNTA(A2:A) = 0, "", SEQUENCE(COUNTA(A2:A))).- Dates display as numbers. Format the output cells as Date (Format > Number > Date).
- Decimal steps look imprecise. Floating-point rounding can cause tiny errors, e.g.
0.30000000000000004. Wrap inROUNDif needed.
SEQUENCE vs. drag-filling vs. ROW()
Drag-filling creates static values. ROW()-1 gives a counter that breaks when rows are inserted or deleted. SEQUENCE generates a clean, self-adjusting list in one formula and can be fed to other functions directly, which neither alternative can do.
Frequently asked questions
Can SEQUENCE produce letters? Not directly, but CHAR(SEQUENCE(26, 1, 65)) returns A to Z (the numbers 65 to 90 are the character codes).
Is there a maximum size? It is bounded by the sheet's limits (10 million cells in total), and very large arrays slow the file.
How do I count down by 10 from 100? =SEQUENCE(11, 1, 100, -10).
Related Functions
ARRAYFORMULA: Apply a formula across a whole range.INDEX: Pick items from a range by position.TRANSPOSE: Swap rows and columns.FILTER: Return the rows that meet a condition.TODAY: Return the current date.