Syntax
=SEQUENCE(rows, [columns], [start], [step])Arguments
| Argument | Required | Description |
|---|---|---|
rows | Required | Number of rows |
columns | Optional | Number of columns (default 1) |
start | Optional | The first number (default 1) |
step | Optional | The increment (default 1) |
How to use SEQUENCE
When SEQUENCE returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.
SEQUENCE takes 1 required argument and 3 optional arguments. Type =SEQUENCE( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=SEQUENCE(3)Result Spilled result
| A | |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
=SEQUENCE(2, 3, 10, 5)Result Spilled result
| A | B | C | |
|---|---|---|---|
| 1 | 10 | 15 | 20 |
| 2 | 25 | 30 | 35 |
=SEQUENCE(0)Result Related array functions
- PIVOTBYSummarizes data by row and column fields and aggregates the values at each intersection.
- QUERYRuns a query (select, where, group by, order by, limit, offset, label) over a range with optional header rows.
- REDUCEReduces an array to one value by applying a LAMBDA to an accumulator and each value.
- SCANApplies a LAMBDA to each value with a running accumulator and returns every intermediate result.
- SORTSorts the rows or columns of a range or array.
- SORTBYSorts a range or array by the values of other ranges or arrays.
- SORTNReturns the first n rows of a range after sorting, with options for ties.
- TAKEReturns a number of rows or columns from the start (positive) or end (negative) of an array.
- TOCOLReturns the values of an array as a single column.