The SEQUENCE function in Google Sheets is a powerful tool that generates a series of numbers in a specified sequence. This function allows users to create a range of numbers dynamically, making it useful for organizing data, creating lists, or performing calculations without manual input.
Syntax
SEQUENCE(row, column, start, step)
- row: The number of rows to fill with sequential numbers.
- column: The number of columns to fill with sequential numbers.
- start: The first number in the sequence (default is 1).
- step: The increment between each number in the sequence (default is 1).
Example #1
=SEQUENCE(5)
This function will generate a vertical array of five numbers starting from 1, resulting in: 1, 2, 3, 4, 5.
Example #2
=SEQUENCE(3, 2)
This will create a 3-row by 2-column array of sequential numbers starting from 1, producing: 1 2 \n3 4 \n5 6.
Example #3
=SEQUENCE(4, 1, 10, 2)
In this case, the function generates a single column of four numbers, beginning at 10 and increasing by 2: 10, 12, 14, 16.
Error handling
- VALUE! This error occurs if the function parameters are not numbers (e.g., non-numeric values in “row” or “column”).
- REF! This happens when the resulting array exceeds the spreadsheet limits, such as trying to fill a range that is too large.
- NUM! This error indicates that a negative or zero value was supplied for row or column number, which is not allowed.