Description
Use this function to generate a list of sequential numbers in an array. The array can be one-dimensional (a single row or a single column) or two-dimensional, determined by rows and columns arguments.
Syntax
SEQUENCE(rows, [columns], [start], [step])
Inputs
This function accepts the following argument:
| Name | Required | Description | Valid Input |
|---|---|---|---|
rows |
Yes | Number of rows to generate (Defaults to 1) | A positive integer, a cell reference to a cell that contains a positive integer, or a formula which results in a positive integer. |
columns |
No | Number of columns to generate (Defaults to 1) | A positive integer, a cell reference to a cell that contains a positive integer, or a formula which results in a positive integer. |
start |
No | First value in the sequence. (Defaults to 1) | A number, a cell reference to a cell that contains a number, or a formula which results in a number. Note: The sequence always moves in a positive direction, even if the start value is negative. |
step |
No | Value to increment between sequence numbers (Defaults to 1) | A number, a cell reference to a cell that contains a number, or a formula which results in a number. |
Examples
Sample data
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | ID |
Name |
Age |
Department |
Salary |
| 2 | 1 | John Smith | 35 | Sales | 75000 |
| 3 | |||||
| 4 | 2 | Emma Johnson | 28 | Marketing | 65000 |
| 5 | 3 | Michael Chen | 42 | Engineering | 95000 |
| 6 | 4 | Sarah Williams | 31 | HR | 70000 |
Sample formulas
| Use case | Formula | Result | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Populate a vertical set of 3 cells starting with the number 4. | =SEQUENCE(3,,4) |
This populates the three cells starting from the cell the formula is in with the numbers 4, 5, and 6, producing the following:
|
||||||||||||
| Populate 2 rows of of 3 cells starting with the number 1, with the numbers in the individual cells. | =SEQUENCE(2, 3) |
Creates a 2x3 array starting at 1, producing the following:
|
||||||||||||
| Populate 2 columns rows of of 3 cells starting with the number 10, with the numbers in the individual cells. | =SEQUENCE(3, 2, 10, 5) |
Creates 3x2 array starting at 10, incrementing by 5, producing the following:
|
||||||||||||
| Because dates in the Workiva platform are serial numbers, you can easily use SEQUENCE to generate sequential dates. For example, to generate a list of 12 dates corresponding to the first day of the month for all months in a year (2025 in this case) you can use SEQUENCE with the DATE and EDATE functions. | =EDATE(DATE(2025,1,1),SEQUENCE(12,1,0)) |
This formula uses SEQUENCE to create a 12x1 array of cells, and then populates the cells using
|
||||||||||||
| Create a list of the first 12 weekend dates in 2025. | =WORKDAY.INTL(DATE(2025,1,1)-1,SEQUENCE(12),"1111100") |
This formula uses SEQUENCE to create a 12x1 array of cells, and then populates the cells using
|
||||||||||||
| Generate a twelve-month list of month names starting in February. | =TEXT(EDATE(DATE(2022,2,1),SEQUENCE(12,1,0)),"mmmm") |
This formula uses SEQUENCE to create a 12x1 array of cells, and then populates the cells using
|
||||||||||||
| Extract the first 3 values from the range (B2:B12), excluding any empty cells from the results. | =INDEX(FILTER(B2:B12, B2:B12<>""), SEQUENCE(3,1,1,1)) |
This formula uses SEQUENCE to create a 3x1 array of cells, and then populates the cells using
|
||||||||||||
| Create a full year calendar | =SEQUENCE(53,7,46023) |
This formula uses SEQUENCE to create a 53x7 array of cells, and then populates the cells staring with Jan 1 2026 (46023). Note: You will have to apply the desired date format to the cells to display the values as dates. |
Notes
- As with all array functions, SEQUENCE dynamically populates results across adjacent cells, starting from the cell containing the SEQUENCE function.
- SEQUENCE:
- Is useful for generating test data or creating numeric sequences.
- Can create single-column, multi-column, or 2D arrays.
- Supports custom start values and step increments.
- Works with both positive and negative increments.
- Can generate a numeric array inside another formula, a requirement that comes up frequently in more advanced formulas.
Tips
- If you have a header row and don't want the headers to be included, start your array values one row down (for example in the data set above, start with A2 rather than A1).
- SEQUENCE can be combined with other functions such as:
Related Functions
Here are the other array formula functions supported in Workiva spreadsheets.