How to Use SEQUENCE Function in Google Sheets
The SEQUENCE function in Google Sheets is a versatile function that generates an array of sequential numbers. It can be used to create a series of numbers in rows, columns, or both. It is especially useful when you need a list of consecutive numbers, dates, or even text strings.
Here's how to use the SEQUENCE function in Google Sheets:
Syntax:
SEQUENCE(rows, columns, [start], [step])
- rows: The number of rows for the output array.
- columns: The number of columns for the output array.
- [start]: (Optional) The first number in the sequence. Default is 1.
- [step]: (Optional) The increment between each consecutive number. Default is 1.
Example
Let's create a sequence of numbers from 1 to 10 in a single column.
- Open your Google Sheet.
- Click on an empty cell where you want the sequence to start, for example, A1.
- Type the following formula in the cell:
=SEQUENCE(10, 1)
- Press Enter.
Now you will see a sequence of numbers from 1 to 10 in column A.
Customizing the SEQUENCE function
You can also customize the SEQUENCE function by specifying the start and step values.
Example: Creating a sequence with custom start and step values
Let's create a sequence of even numbers from 2 to 20.
- Click on an empty cell, for example, B1.
- Type the following formula in the cell:
=SEQUENCE(10, 1, 2, 2)
- Press Enter.
Now you will see a sequence of even numbers from 2 to 20 in column B.
Creating a sequence in rows and columns
You can also create a sequence of numbers that spans across multiple rows and columns.
Example: Creating a sequence in a 2x5 array
Let's create a sequence of numbers from 1 to 10 in a 2x5 array.
- Click on an empty cell, for example, C1.
- Type the following formula in the cell:
=SEQUENCE(2, 5)
- Press Enter.
Now you will see a sequence of numbers from 1 to 10 arranged in a 2x5 array starting from cell C1.