The SEQUENCE function
A series of numbers in one formula: number rows, build a calendar, generate dates.
Syntax
=SEQUENCE(rows, [columns], [start], [step])
In a French Excel: =SEQUENCE(lignes; [colonnes]; [début]; [pas]).
Arguments
- rows: how many rows.
- columns: how many columns; 1 by default.
- start: the first number; 1 by default.
- step: the gap between two numbers; 1 by default.
An example
=SEQUENCE(31,1,DATE(2024,1,1))
The 31 days of January 2024, to format as dates.
Pitfalls
- Occupied cells: #SPILL!.
- Missing from Excel 2019 and earlier.
Going further
Frequently asked questions
- How do I number the rows of a table that changes size?
=SEQUENCE(COUNTA(A2:A1000))gives as many numbers as there are filled rows.