
The SEQUENCE function in Excel is a versatile function that generates a sequence of numbers in a specified array size. It can be particularly useful for creating numerical sequences for use in tables or further calculations. Here’s how you can use the SEQUENCE function:
Basic Syntax
SEQUENCE(rows, [columns], [start], [step])
- rows (required): The number of rows to fill with numbers.
- columns (optional): The number of columns to fill with numbers. If omitted, it defaults to 1.
- start (optional): The starting number for the sequence. If omitted, it defaults to 1.
- step (optional): The increment for each subsequent number in the series. If omitted, it defaults to 1.
Examples
- Simple Vertical Sequence
To generate a vertical list of numbers from 1 to 5:
=SEQUENCE(5)
This will create a single column with numbers 1, 2, 3, 4, and 5.
- Horizontal Sequence
To generate a horizontal list of numbers from 1 to 5 across one row:
=SEQUENCE(1, 5)
This will create a single row with numbers 1, 2, 3, 4, and 5.
- Starting from a Specific Number
To start the sequence at 10 and list the next 5 numbers:
=SEQUENCE(5, 1, 10)
This generates a single column with numbers 10, 11, 12, 13, and 14.
- Custom Step Size
To generate a list with a step of 2:
=SEQUENCE(5, 1, 1, 2)
This will produce numbers 1, 3, 5, 7, and 9 in a column.
- Two-Dimensional Array
To fill a grid with a sequence of numbers, specify both rows and columns:
=SEQUENCE(3, 3)
This creates a 3×3 array with numbers 1 to 9.
Practical Applications
- Date Sequences: Generate a series of dates, such as weekdays or months, for scheduling or timeline analysis.
- Matrix Initialization: Quickly set up matrices or grids with sequential numbers.
- Data Validation: Use sequences for pre-filling lists or validating data input.
The SEQUENCE function is available in Excel 365 and Excel 2019, as part of the array formula features, so make sure your version of Excel supports this function before attempting to use it.