How to generate a sequence of numbers in Excel
Formula (Excel and Google Sheets)
=SEQUENCE(B1,1,B2,B3)Use SEQUENCE(rows, columns, start, step): =SEQUENCE(B1,1,B2,B3) returns B1 numbers starting at B2, counting up by B3.
- Result on the example
- a 10-row list that spills from D2 in
D2 - Works in
- Excel 2021, 2024 and Microsoft 365
- Google Sheets
- Same formula
See it work
The formula is already in D2. Change any input and the result updates, or edit the formula to experiment.
How it works
SEQUENCE builds the whole list in one formula: 10 rows, 1 column, starting at 100, adding 5 each step. Change any of the three inputs and the list redraws, so there's nothing to drag or refill.
=SEQUENCE(B1,1,B2,B3)Result{10 rows × 1 col} 100, 105, 110, 115, …
B110The value in B1.
B2100The value in B2.
B35The value in B3.
SEQUENCE(B1,1,B2,B3){10 rows × 1 col} 100, 105, 110, 115, …SEQUENCE: A grid of sequential numbers. Spills.- rows
B110 - columns
1 - start
B2100 - step
B35
- rows
In Google Sheets
The same formula works in Google Sheets: =SEQUENCE(B1,1,B2,B3). We ran it in Google Sheets mode on the same data and it returns the same results, spilling 10 rows.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =B2+(SEQUENCE(B1)-1)*B3 | spills 10 × 1 | The same list from SEQUENCE's default 1, 2, 3: handy when the step is a calculation. |
| =SEQUENCE(1,B1,B2,B3) | spills 1 × 10Different result | Swap the first two arguments to fill across a row. The same ten numbers in one row. |
Common mistakes
- The order is rows, then columns.
SEQUENCE(1,10)fills a row;SEQUENCE(10)fills a column. - A decimal step such as 0.1 can show tiny rounding errors (0.30000000000000004) in calculations. Wrap it in ROUND if you compare the values.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Generate a sequence of numbers
D2, generate B1 numbers in a column, starting at B2 and going up by B3 each time.Questions
How do I count down?
Use a negative step: =SEQUENCE(10,1,10,-1) gives 10 down to 1.
How do I make a grid of numbers?
Give rows and columns: =SEQUENCE(5,4) numbers a 5 by 4 block from 1 to 20, row by row.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.