The SEQUENCE function in Excel generates a list of sequential numbers in a single formula, saving you from dragging the fill handle or typing numbers manually. It can create rows, columns, or a two-dimensional array of numbers, and you can control the start value and the increment between each number. This guide walks you through every use case, from the basic syntax to dynamic arrays, with clear steps and troubleshooting.
What You'll Need
- Excel 365 or Excel 2021 (the SEQUENCE function is part of the dynamic array functions, so it is not available in Excel 2019 or earlier).
- A worksheet where you want the numbers to appear. The result will spill into adjacent cells, so make sure there is empty space to the right and below the cell where you enter the formula.
- Basic familiarity with entering formulas (starting with an equals sign).
Step-by-Step
1. Understand the Syntax
The SEQUENCE function has four arguments, all of which are optional (but at least one is usually used):
=SEQUENCE(rows, [columns], [start], [step])
- rows: The number of rows to fill with numbers.
- columns: The number of columns to fill. If omitted, it defaults to 1.
- start: The first number in the sequence. Defaults to 1.
- step: The increment between each number. Defaults to 1.
2. Create a Basic Column of Numbers
To generate a vertical list of numbers from 1 to 10 in column A, click on cell A1 and type:
=SEQUENCE(10)
Press Enter. Excel will spill the numbers 1 through 10 down from A1 to A10. The formula bar will show the formula, and the cells will be highlighted with a blue border, indicating a spilled array.
3. Create a Row of Numbers
To generate a horizontal list, set the rows argument to 1 and specify the columns. For example, to get 1 to 5 across row 1, click B1 and type:
=SEQUENCE(1,5)
Press Enter. The numbers 1, 2, 3, 4, 5 will appear in B1 through F1.
4. Control the Start Value
If you want the sequence to begin at a number other than 1, use the third argument. For instance, to start at 100 and go to 109, type:
=SEQUENCE(10,1,100)
This gives you 100, 101, 102, ... 109 in a column.
5. Control the Increment (Step)
To generate even numbers, set the step to 2. For example, to get 2, 4, 6, 8, 10 in a row, type:
=SEQUENCE(1,5,2,2)
Here, start is 2 and step is 2. For odd numbers, use start=1 and step=2.
6. Create a Two-Dimensional Array (Grid)
You can fill a block of cells with numbers row by row. For example, to create a 3-row by 4-column grid of numbers 1 to 12, click A1 and type:
=SEQUENCE(3,4)
Press Enter. You will get:
1 2 3 4
5 6 7 8
9 10 11 12
The numbers fill row by row, then move to the next row.
7. Combine SEQUENCE with Other Functions
SEQUENCE is often used as a helper for other functions. For example, to sum the first 10 integers, you can use:
=SUM(SEQUENCE(10))
This returns 55. Similarly, to get the average of even numbers from 2 to 20, use:
=AVERAGE(SEQUENCE(10,1,2,2))
8. Use SEQUENCE to Create a Calendar or Date List
You can generate a list of dates by combining SEQUENCE with the DATE function. For example, to list the first 7 days of January 2025, type:
=DATE(2025,1,1)+SEQUENCE(7,1,0,1)
This starts at January 1 (since the start is 0 added to the date) and adds 1 day each row. Format the cells as dates to see them properly.
9. Use SEQUENCE to Repeat Values
You can use SEQUENCE to repeat a value a certain number of times. For example, to repeat the word "Apple" 5 times in a column, use:
=IF(SEQUENCE(5),"Apple")
This works because SEQUENCE returns numbers that are treated as TRUE in the IF function.
10. Use SEQUENCE with the SORT or FILTER Functions
SEQUENCE can generate an index for sorting. For example, to sort a list in reverse order, you can use SORT with a helper column. But a simpler use is to generate a list of numbers that you then use in another formula. For instance, to get the top 3 values from a range, you can use LARGE with SEQUENCE:
=LARGE(A1:A10, SEQUENCE(3))
This returns the three largest values in the range.
Common Mistakes
- Forgetting the rows argument: If you omit the rows argument, SEQUENCE defaults to 1 row, which may not be what you want. Always specify rows unless you intentionally want a single row.
- Not leaving space for the spill: If there is data in any cell where the sequence would spill, you get a #SPILL! error. Clear those cells or move the formula to a location with empty space.
- Using negative step with a start that goes below 1: That's fine, but be aware that SEQUENCE will happily generate negative numbers if you ask for them. For example,
=SEQUENCE(3,1,5,-2)gives 5, 3, 1. - Typing the arguments in the wrong order: The order is rows, columns, start, step. If you swap start and step, you'll get unexpected results.
- Using SEQUENCE in a table: Dynamic array formulas do not work inside Excel Tables (structured references). If you need a sequence in a table, use a regular range instead.
Tips
- Use the # operator: To reference the entire spill range of a SEQUENCE formula, use the # operator. For example, if you have
=SEQUENCE(5)in A1, you can use=SUM(A1#)to sum all the numbers. - Make the sequence dynamic: You can base the rows argument on another cell. For example,
=SEQUENCE(B1)will generate as many numbers as are in cell B1. Change B1 and the sequence updates. - Combine with TEXT for formatting: To display numbers with leading zeros, use
=TEXT(SEQUENCE(5),"00")but note this returns text, not numbers. - Use SEQUENCE to create a list of months:
=DATE(2025,SEQUENCE(12),1)gives the first day of each month in 2025. - Remember that SEQUENCE is volatile: It recalculates whenever Excel recalculates, which is fine for most uses, but if you have a huge number of them, performance may slow down.
Troubleshooting
#SPILL! Error
This is the most common error. It means the result would overwrite existing cells. To fix it, check the cells in the spill area (the blue border) and clear any data. If you still see the error, look for merged cells in the spill area—SEQUENCE cannot spill into merged cells. Unmerge them. Also, if the formula is in a table, it will cause a spill error; move it outside the table.
#VALUE! Error
This usually means one of the arguments is not a number. For example, if you reference a cell that contains text, you'll get this error. Make sure all arguments are numeric. Also, if you use a negative number for rows or columns, you'll get a #VALUE! error because rows and columns must be positive.
#NAME? Error
This means Excel doesn't recognize the function. You are probably using an older version of Excel (2019 or earlier) that does not support dynamic arrays. Upgrade to Microsoft 365 or Excel 2021. If you are on a Mac, make sure you have the latest version.
Sequence Not Updating
If you change the arguments and the sequence doesn't update, check that automatic calculation is on. Go to Formulas > Calculation Options and select Automatic. If you are using manual calculation, press F9 to recalculate.
Only the First Number Appears
If you see only the first number and no spill, it might be because you are in a cell that is part of a table, or because the formula was entered as an array formula (with Ctrl+Shift+Enter) in older Excel. In modern Excel, just press Enter. If you are using Excel 2021, make sure you are not in compatibility mode.
Frequently Asked Questions
Can I use SEQUENCE to generate a list of letters (A, B, C)?
Yes, but you need to use the CHAR function. For example, =CHAR(SEQUENCE(5,1,65,1)) gives A, B, C, D, E because 65 is the ASCII code for 'A'.
How do I make the sequence go downward first, then across?
SEQUENCE always fills row by row, then column by column. To fill column by column, you need to transpose the result using the TRANSPOSE function: =TRANSPOSE(SEQUENCE(4,3)) will fill down first.
Can SEQUENCE generate decimal numbers?
Yes, you can use a decimal step. For example, =SEQUENCE(5,1,0,0.5) gives 0, 0.5, 1, 1.5, 2.
Does SEQUENCE work in Excel Online or Google Sheets?
SEQUENCE works in Excel Online (Microsoft 365) because it supports dynamic arrays. Google Sheets has a similar function called SEQUENCE, but the syntax is different: =SEQUENCE(rows, columns, start, step)—actually it's the same, but you need to use it differently. In Google Sheets, it works similarly, but it's not exactly the same as Excel's.
Can I use SEQUENCE to create a list of dates that only includes weekdays?
Yes, but you need to combine it with WORKDAY or FILTER. For example, to get the first 5 weekdays from a start date, use =WORKDAY(start_date-1, SEQUENCE(5)). This is a bit advanced, but it works.
Why does my SEQUENCE formula show a #CALC! error?
#CALC! is rare and usually means the formula is trying to perform an operation that is not supported, like referencing a spilled array that doesn't exist. Check that the referenced spill range is valid and that you haven't deleted a cell that the formula depends on.