Dynamic arrays function
SEQUENCE function in Google Sheets and Excel
SEQUENCE returns a list or grid of numbers: 1 to 12, every second number, or numbers starting where you choose.
Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
Syntax
SEQUENCE(rows, [columns], [start], [step])Arguments in [brackets] are optional. Google Sheets writes it SEQUENCE(rows, columns, start, step).
Example
=DATE(B1,SEQUENCE(12),1) reads: Make the numbers 1 to 12 and turn each into the first day of that month of the year in B1.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Year | 2026 | Month | |||
| 2 | Jan 2026 | |||||
| 3 | Holidays | Feb 2026 | ||||
| 4 | 1 Jan 2026 | Mar 2026 | ||||
| 5 | 3 Apr 2026 | Apr 2026 | ||||
| 6 | 6 Apr 2026 | May 2026 | ||||
| 7 | 1 May 2026 | Jun 2026 | ||||
| 8 | 25 Dec 2026 | Jul 2026 | ||||
| 9 | Aug 2026 | |||||
| 10 | Sep 2026 | |||||
| 11 | Oct 2026 | |||||
| 12 | Nov 2026 | |||||
| 13 | Dec 2026 |
D2 shows Jan 2026 and the list spills down to Dec 2026 in D13.
How the spreadsheet calculates it
Builds the date with year B1, month the result of SEQUENCE (step 1) and day 1.
- 1. SEQUENCE: Makes a list of
12number(s), starting at1and going up by1. It spills.rows=`12`: how many numbers to make, counting from 1
- 2. DATE: Builds the date with year
B1, month the result of step 1 and day1.year=`B1`: a four-digit yearmonth=the result of step 1: 1 to 12 (bigger numbers roll into the next year)day=`1`: the day of the month
More SEQUENCE examples
=SEQUENCE(12)The numbers 1 to 12 in a column.=DATE(2026,SEQUENCE(12),1)The first day of every month in 2026.=SEQUENCE(1,5,0,10)0, 10, 20, 30, 40 across a row.=SEQUENCE(7)+A1-1Seven days starting from the date in A1.
Paste any of these into the formula explainer to see it step by step.
Tips
- Leave enough empty cells for the whole result to spill.
- Use step to count by any amount, including negative steps to count down.
- Combine it with other functions (DATE, INDEX) to turn positions into dates or items.
- Use columns to make a grid:
SEQUENCE(3, 4)fills 3 rows by 4 columns.
What SEQUENCE is used for
Numbering rows, building calendars and month lists, generating test data, and feeding other dynamic-array formulas a list of positions.
Arguments
| Argument | Required | What it is |
|---|---|---|
| rows | Yes | How many rows of numbers. |
| columns | No | How many columns; 1 by default. |
| start | No | The first number; 1 by default. |
| step | No | How much each number adds; 1 by default, and it can be negative. |
Common mistakes
Something typed below the formula: #SPILL!.
Typing in the cells the list needs (#SPILL!).
Using it in Excel 2019 or older, where it doesn't exist.
In Google Sheets
Google Sheets has SEQUENCE with the same four arguments.
Errors you may see with SEQUENCE
Questions
How do I make a list of dates?
Add a SEQUENCE to a start date, start + SEQUENCE(7) - 1 for a week, or build months with DATE(year, SEQUENCE(12), 1) as in the example.
How do I refer to the whole list?
In Excel, with the spill operator: D2#. Google Sheets has no # operator.
How do I number rows that grow?
Combine it with COUNTA: SEQUENCE(COUNTA(A2:A100)) numbers as many rows as there are entries.
Can SEQUENCE make decimals?
Yes: start and step can be any number, so SEQUENCE(5, 1, 0, 0.25) gives 0, 0.25, 0.5, 0.75 and 1.
Sources
Official documentation the facts on this page were checked against.