The SEQUENCE function in Excel generates a list of sequential numbers in a grid, allowing you to create arrays of numbers automatically without manually dragging the fill handle. To use it, enter =SEQUENCE(rows, [columns], [start], [step]) into a cell, and Excel will automatically spill the resulting numbers into the adjacent cells based on the arguments you provide.
What You'll Need
- A subscription to Microsoft 365 or a version of Excel that supports Dynamic Arrays (such as Excel 2021 or Excel for the Web).
- A blank area of your spreadsheet where the sequence can "spill" without hitting existing data.
- A basic understanding of how to enter formulas into a cell.
Step-by-Step
- Select the starting cell: Click on the cell where you want the top-left corner of your sequence to begin. Ensure there is enough empty space below and to the right of this cell to accommodate the size of the list you are creating.
- Begin the formula: Type
=SEQUENCE(into the cell. This opens the function and prepares Excel to receive your parameters. - Define the number of rows: Enter the number of rows you want the sequence to fill. For example, if you want a list of 10 numbers going down a column, type
10. This is the only required argument. - Define the number of columns (Optional): Add a comma, then enter the number of columns. If you only want a single column, you can skip this or enter
1. For a grid (e.g., 5 rows and 3 columns), you would enter5, 3. - Set the starting value (Optional): Add another comma and enter the number where the sequence should begin. By default, Excel starts at 1. If you want your list to start at 100, enter
100. - Set the step value (Optional): Add a final comma and enter the increment between each number. By default, this is 1. If you want to count by fives, enter
5. If you enter a negative number, the sequence will count backward. - Close and execute: Type the closing parenthesis
)and press Enter. The numbers will immediately populate the range.
Common Mistakes
One of the most frequent errors is the #SPILL! error. This happens when you try to generate a sequence in a range that already contains data. Because the SEQUENCE function is a dynamic array formula, it needs a completely clear path to output its results. If even one cell in the intended range has a stray space or a hidden character, the entire formula will fail. Always clear the destination area before entering the formula.
Another common mistake is confusing the row and column arguments. The first argument is always for the vertical axis (rows) and the second is for the horizontal axis (columns). If you intended to create a wide row of 10 numbers but entered =SEQUENCE(10, 1), you will get a long column instead. The correct syntax for a horizontal list is =SEQUENCE(1, 10).
Users also occasionally forget that the step value can be a decimal. Some attempt to use a separate formula to handle fractions, but the SEQUENCE function can handle this natively. For example, =SEQUENCE(10, 1, 0, 0.1) will create a list from 0 to 0.9 in increments of 0.1. Forgetting this capability often leads to overly complex spreadsheet designs.
Tips
To make your sequences dynamic, avoid hard-coding the number of rows. Instead, link the rows argument to another cell or a function. For example, if you have a list of names in column A and want a corresponding ID number in column B, use =SEQUENCE(COUNTA(A:A)). This ensures that as you add more names to your list, the sequence numbers update automatically without you having to rewrite the formula.
You can combine SEQUENCE with other functions to create powerful tools. For instance, combining it with the DATE function allows you to generate a calendar or a list of business days. Using =SEQUENCE(31, 1, DATE(2023,1,1), 1) will generate every date for the month of January. Just remember to format the resulting cells as "Date" instead of "General" or "Number," otherwise you will see a series of five-digit numbers (Excel's internal date codes).
For those creating custom IDs or invoice numbers, use the starting value argument to keep track of your records. If your last invoice was #500, you can start your next batch with =SEQUENCE(10, 1, 501, 1) to quickly generate the next ten invoice numbers.
Troubleshooting
If the formula returns a #NAME? error, it is almost certain that your version of Excel does not support the SEQUENCE function. This function is only available in Microsoft 365, Excel 2021, and Excel for the Web. If you are using Excel 2019 or earlier, you will not find this function. In these older versions, the alternative is to type "1" and "2" in two cells, select both, and drag the fill handle down, or use the "Fill" button in the Home tab under the Editing group.
If the sequence is producing numbers that are not what you expected, double-check your commas. The order must be Rows, Columns, Start, Step. If you accidentally swap the Start and Step values, your sequence will jump by huge increments or start at a strange number. For example, =SEQUENCE(10, 1, 1, 5) starts at 1 and goes 6, 11, 16... whereas =SEQUENCE(10, 1, 5, 1) starts at 5 and goes 6, 7, 8...
If you see a #VALUE! error, ensure that all arguments entered are numbers. The SEQUENCE function cannot process text or logical values (like TRUE/FALSE) within its arguments. If you are referencing other cells for your arguments, make sure those cells contain numeric values and not text that looks like a number.
Frequently Asked Questions
Can I create a sequence that counts backwards?
Yes. To count backwards, set the "step" argument to a negative number. For example, =SEQUENCE(10, 1, 10, -1) will create a list from 10 down to 1.
How do I make the sequence go across a row instead of down a column?
Set the first argument (rows) to 1 and the second argument (columns) to the number of items you want. Example: =SEQUENCE(1, 10).
Can I use the SEQUENCE function to create a list of dates?
Yes. Use a start date (via the DATE function) as the starting value and a step of 1. Then, format the resulting cells as Dates.
What happens if I change the data in the cells where the sequence spills?
If you manually type over a cell that is part of a spilled sequence, the entire sequence will disappear and be replaced by a #SPILL! error because the formula no longer has room to output its data.
Is there a limit to how many numbers SEQUENCE can generate?
The limit is based on the maximum number of rows and columns in an Excel worksheet (1,048,576 rows and 16,384 columns). However, generating millions of numbers may slow down your computer's performance.
Can I use SEQUENCE to create a grid of numbers?
Yes. By providing both a row and a column count, such as =SEQUENCE(5, 5), Excel will create a 5x5 grid of numbers starting from 1 and ending at 25.