ZetCode

Excel SEQUENCE Function

last modified October 5, 2026

The SEQUENCE function is a dynamic array function in Excel that generates a list of sequential numbers in an array. The result spills into the adjacent cells, so a single formula can fill a column, a row, or a whole grid and resize itself whenever the arguments change. This tutorial covers the syntax and arguments, one-dimensional and two-dimensional sequences, custom start values and step sizes, date series, combining SEQUENCE with functions such as INDEX and TEXT, and how it compares with the older ROW and INDIRECT workaround.

SEQUENCE Function Basics

The SEQUENCE function generates a list of sequential numbers in an array. It can create one-dimensional or two-dimensional sequences with control over the start value and the step size. rows and columns set the size of the output, start is the first number, and step is the increment between the numbers.

Component Description
Function Name SEQUENCE
Syntax =SEQUENCE(rows,[columns],[start],[step])
Arguments rows (required), columns, start, step (all optional)
Return Value A spilled array of sequential numbers
Availability Excel for Microsoft 365, Excel 2021, Excel 2024, and Excel for the web

The table below describes each argument in more detail.

Argument Meaning
rows Required. The number of rows to return. It must be at least 1.
columns Optional. The number of columns to return. Defaults to 1.
start Optional. The first number in the sequence. Defaults to 1. It may be negative or zero.
step Optional. The amount added to each subsequent value. Defaults to 1. It may be negative, zero, or a decimal.

SEQUENCE takes four arguments, of which only the first is required. Every missing optional argument defaults to 1, so =SEQUENCE(5) is the same as =SEQUENCE(5,1,1,1). If you omit rows, you must supply at least one other argument; for example, =SEQUENCE(,5) returns the horizontal array {1,2,3,4,5}.

Because the result is a dynamic array, it needs enough empty cells to spill into; otherwise Excel reports a #SPILL! error. The function is available only in Excel 2021 and later and in Microsoft 365. In Excel 2019 and earlier the function does not exist and produces a #NAME? error.

Basic SEQUENCE Example

This example demonstrates the simplest use of the SEQUENCE function to generate a vertical list of numbers.

Basic SEQUENCE formula
=SEQUENCE(5)

This formula creates a sequence of 5 numbers starting from 1 in a single column. The result will be numbers 1 through 5 vertically. This shows the minimal required argument for SEQUENCE.

A
1
2
3
4
5

Two-Dimensional Sequence

SEQUENCE can generate a grid of numbers by specifying both rows and columns. This example creates a 3x3 matrix.

2D SEQUENCE formula
=SEQUENCE(3,3)

This formula generates a 3-row by 3-column array starting from 1. The numbers fill left to right, then top to bottom. The result is a perfect square number grid.

A B C
1 2 3
4 5 6
7 8 9

Sequence with Custom Start and Step

You can control the starting value and increment of the sequence. This example shows a sequence starting at 10 with steps of 5.

Custom SEQUENCE formula
=SEQUENCE(4,1,10,5)

This formula creates a 4-row, 1-column sequence starting at 10 with each subsequent number increasing by 5. The result demonstrates precise control over sequence parameters.

A
10
15
20
25

Descending Sequence

SEQUENCE can generate decreasing sequences by using a negative step value. This example counts down from 100.

Descending SEQUENCE formula
=SEQUENCE(5,1,100,-20)

This formula creates a 5-number sequence starting at 100 and decreasing by 20 each step. The negative step parameter enables reverse counting functionality.

A
100
80
60
40
20

Step Sizes

The step argument accepts negative values, decimals, and zero. A negative step counts down, a decimal step creates fractions, and a step of zero repeats the start value in every cell instead of raising an error.

Formula Result Meaning
=SEQUENCE(3,1,5,-1) {5;4;3} Negative step counts down
=SEQUENCE(4,1,0,0.25) {0;0.25;0.5;0.75} Decimal step builds fractions
=SEQUENCE(5,1,1,0) {1;1;1;1;1} Zero step repeats the start value

The rows and columns arguments behave differently from start and step: they must be whole numbers of at least 1, and a decimal such as 2.7 is truncated rather than rounded, so =SEQUENCE(2.7) returns {1;2}. Neither start nor step is restricted to positive values.

Date Sequence

SEQUENCE works with dates since Excel stores them as date serial numbers. This example generates seven consecutive days starting from a specific day.

Date SEQUENCE formula
=SEQUENCE(7,1,DATE(2025,1,1),1)

This formula creates a 7-day sequence starting from January 1, 2025. The step of 1 represents daily increments. The spilled values are plain numbers, so format the cells as dates to display them properly.

A
1/1/2025
1/2/2025
1/3/2025
1/4/2025
1/5/2025
1/6/2025
1/7/2025

Generating a Date Series

Because dates are numbers, the step argument can move the series by any number of days. A step of 7 produces weekly dates, which is the usual way to build reports that repeat every week.

Weekly date SEQUENCE formula
=SEQUENCE(4,1,DATE(2023,1,1),7)

The formula returns four dates, seven days apart, beginning with January 1, 2023. The underlying values are the serial numbers 44927, 44934, 44941, and 44948; apply a date number format to read them as dates.

A
1/1/2023
1/8/2023
1/15/2023
1/22/2023

A step of 30 approximates a month, but months have different lengths, so for exact calendar months generate month offsets instead and let EDATE do the date arithmetic: =EDATE(DATE(2023,1,1),SEQUENCE(12,1,0)) returns the first day of each month in 2023.

Combining SEQUENCE with Other Functions

SEQUENCE becomes even more powerful when combined with other functions. This example creates a multiplication table.

Multiplication table formula
=SEQUENCE(10)*SEQUENCE(1,10)

This formula multiplies a vertical sequence (1-10) by a horizontal sequence (1-10). Excel expands the column and the row into a two-dimensional result, so all 100 products are calculated at once and the answer spills as a complete 10x10 multiplication table.

A B C ... J
1 2 3 ... 10
2 4 6 ... 20
3 6 9 ... 30
... ... ... ... ...
10 20 30 ... 100

Wrapping SEQUENCE with INDEX and TEXT

SEQUENCE returns an array, so it can be consumed by other functions instead of being displayed. INDEX picks a single value out of the generated list, which is useful when the sequence itself is only an intermediate step.

INDEX with SEQUENCE
=INDEX(SEQUENCE(4,1,10,5),3)

The inner formula produces {10;15;20;25} and INDEX returns the third item, which is 20. The nested sequence stays inside the formula, so only one cell is used and nothing spills.

TEXT converts each number of the sequence into a formatted string, which is the usual way to display dates or labels generated by SEQUENCE.

TEXT with SEQUENCE
=TEXT(SEQUENCE(4,1,DATE(2023,1,1),7),"mmm d, yyyy")
A
Jan 1, 2023
Jan 8, 2023
Jan 15, 2023
Jan 22, 2023

The result is text, so it can no longer be used in date calculations; keep the raw sequence when you need to compute with the values and wrap it in TEXT only for the display. The same idea works for plain numbers, for example =TEXT(SEQUENCE(4,1,1,1),"000") returns 001, 002, 003, 004.

SEQUENCE vs ROW and INDIRECT

Before SEQUENCE existed, formulas built number lists with ROW and INDIRECT. You will still meet these patterns in older workbooks and in forum answers.

Legacy number list
=ROW(INDIRECT("1:"&n))
=ROW(A1:A10)-ROW(A1)+1

Both forms work, but each has a weakness. INDIRECT is volatile, so any formula that uses it recalculates whenever anything in the workbook changes. ROW(A1:A10) depends on a real range, so inserting or deleting rows inside that range changes how many numbers it returns, and the text passed to INDIRECT is never adjusted by Excel.

The SEQUENCE equivalents are shorter and free of those problems: =SEQUENCE(n) returns the numbers 1 to n and =SEQUENCE(10,1,10,-1) counts down from 10 to 1. The function is not volatile, does not depend on any cell reference, and does not require Ctrl+Shift+Enter. Keep the older forms only when the workbook must stay compatible with Excel 2019 or earlier.

SEQUENCE Errors and Troubleshooting

Cause Symptom Fix
rows or columns is 0 #CALC! error The result would be an empty array; use at least 1
rows or columns is negative #VALUE! error Supply a positive whole number
An argument contains text that cannot be read as a number #VALUE! error Pass a number or a formula that returns one, and test the input with ISNUMBER
rows or columns has a decimal, such as 2.7 No error, but the value is truncated to 2 Use INT or a whole number so the array is the size you expect
Spill range is blocked by other data #SPILL! error Clear the cells the result needs, or move the formula
Formula is entered inside an Excel Table #SPILL! error Tables cannot spill; move the formula outside the table
Opened in Excel 2019 or earlier #NAME? error Use Excel 2021, Excel 2024, or Microsoft 365
Requested array is larger than the worksheet #SPILL! for more than 16,384 columns, #VALUE! for more than 1,048,576 rows Reduce the size so the result fits on the sheet

A step of zero is not an error: =SEQUENCE(5,1,1,0) deliberately returns {1;1;1;1;1}. When an argument comes from a cell, guard the whole formula with IFERROR, for example =IFERROR(SEQUENCE(A1),0), so an invalid count falls back to a value you choose instead of showing an error.

The SEQUENCE function replaces one of the oldest workarounds in Excel with a single, readable argument list. From a simple numbered list to a two-dimensional grid, from daily and weekly date series to outer products such as a full multiplication table, one formula produces the whole array and keeps it correct when the inputs change. Remember the three rules that cover almost every problem: rows and columns must be whole numbers of at least 1, the result needs empty cells to spill into, and the function requires Excel 2021 or later. Master those points and SEQUENCE will remove the dragging, helper columns, and volatile INDIRECT formulas from your worksheets.

Author

My name is Jan Bodnar, and I am a passionate programmer with extensive programming experience. I have been writing programming articles since 2007. To date, I have authored over 1,400 articles and 8 e-books. I possess more than ten years of experience in teaching programming.

List all Excel Formulas.