FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

SEQUENCE in Google Sheets

SEQUENCE fills a block of cells from one formula in Google Sheets with no ARRAYFORMULA wrapper.

Syntax (same in Google Sheets)

SEQUENCE(rows, [columns], [start], [step])

It is a tidy way to number rows: SEQUENCE(ROWS(A2:A20)) matches the length of a data range.

For a fuller explanation of the arguments and common errors, see the SEQUENCE Excel guide.

Worked examples in Google Sheets

Steps of five

A
1

Formula: A1: =SEQUENCE(4,1,10,5)

Result: Spills down: 10, 15, 20, 25

Four numbers start at 10 and rise by 5 each.

Sum of the first ten numbers

A
1

Formula: A1: =SUM(SEQUENCE(10))

Result: 55

The default start and step give 1 to 10, which add up to 55.

A grid fills row by row

A
1

Formula: A1: =INDEX(SEQUENCE(3,4),2,3)

Result: 7

A 3-by-4 grid counts across each row first, so row 2, column 3 holds 7.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =SEQUENCE(4,3)

Example spreadsheet for SEQUENCE
ABCDEFGH
1RegionProductUnitsPriceResult
2EastPen1202.5123
3WestPen802.5456
4EastBook4512789
5NorthBook6012101112
6WestLamp3025
7EastLamp1525
Result in F2: 1
Practice this in a lesson: SEQUENCE, TEXTSPLIT, TRANSPOSE

Frequently asked questions

How do I number rows automatically in Google Sheets?
Enter =SEQUENCE(n) in the first cell, where n is the number of rows; the numbers spill downward and change when you change n.

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.