Excel SEQUENCE function - create a number series automatically

In this tutorial, you will learn how to create a number sequence in Excel with formulas. Additionally, we'll show you how to auto generate a series of Roman numbers and random integers - all by using a new dynamic array SEQUENCE function.

The times when you had to put numbers in sequence in Excel manually are long gone. In modern Excel, you can make a simple number series in a flash with the Auto Fill feature. If you have a more specific task in mind, then use the SEQUENCE function, which is specially designed for this purpose.

Excel SEQUENCE function

The SEQUENCE function in Excel is used to generate an array of sequential numbers such as 1, 2, 3, etc.

It is a new dynamic array function introduced in Microsoft Excel 365. The result is a dynamic array that spills into the specified number of rows and columns automatically.

The function has the following syntax:

SEQUENCE(rows, [columns], [start], [step])

Where:

Rows (optional) - the number of rows to fill.

Columns (optional) - the number of columns to fill. If omitted, defaults to 1 column.

Start (optional) - the starting number in the sequence. If omitted, defaults to 1.

Step (optional) - the increment for each subsequent value in the sequence. It can be positive or negative.

  • If positive, subsequent values increase, creating an ascending sequence.
  • If negative, subsequent values decrease, producing a descending sequence.
  • If omitted, the step defaults to 1.

The SEQUENCE function is only supported in Excel for Microsoft 365, Excel 2021, and Excel for the web.

Basic formula to create a number sequence in Excel

If you are looking to populate a column of rows with sequential numbers starting at 1, you can use the Excel SEQUENCE function in its simplest form:

To put numbers in a column:

SEQUENCE(n)

To place numbers in a row:

SEQUENCE(1, n)

Where n is the number of elements in the sequence.

For example, to populate a column with 10 incremental numbers, type the below formula in the first cell (A2 in our case) and press the Enter key:

=SEQUENCE(10)

The results will spill in the other rows automatically.
Creating a 1 column sequence with a formula

To make a horizontal sequence, set the rows argument to 1 (or omit it) and define the number of columns, 8 in our case:

=SEQUENCE(1,8)
Formula to generate a horizontal sequence

If you'd like to fill a range of cells with sequential numbers, then define both the rows and columns arguments. For instance, to populate 5 rows and 3 columns, you'd use this formula:

=SEQUENCE(5,3)
Using the SEQUENCE function to fill a range of cells

To start with a specific number, say 100, supply that number in the 3rd argument:

=SEQUENCE(5,3,100)
A sequence starting at a specific number

To generate a list of numbers with a specific increment step, define the step in the 4th argument, 10 in our case:

=SEQUENCE(5,3,100,10)
A sequence incrementing by a specific step

Translated into plain English, our complete formula reads as follows:
Excel SEQUENCE formula

SEQUENCE function - things to remember

To efficiently do a sequence of numbers in Excel, please remember these 4 simple facts:

  • The SEQUENCE function is only available with Microsoft 365 subscriptions and Excel 2021. In Excel 2019, Excel 2016 and earlier versions, it does not work since those versions do not support dynamic arrays.
  • If the array of sequential numbers is the final result, Excel outputs all the numbers automatically in a so-called spill range. So, be sure you have enough empty cells down and to the right of the cell where you enter the formula, otherwise a #SPILL error will occur.
  • The resulting array can be one-dimensional or two-dimensional, depending on how you configure the rows and columns arguments.
  • Any optional argument that is not set defaults to 1.

How to create a number sequence in Excel - formula examples

Though the basic SEQUENCE formula does not look very exciting, when combined with other functions, it takes on a whole new level of usefulness.

Make a decreasing (descending) sequence in Excel

To generate a descending sequential series, such that each subsequent value is less than the preceding one, supply a negative number for the step argument.

For example, to create a list of numbers starting at 10 and decreasing by 1, use this formula:

=SEQUENCE(10, 1, 10, -1)
Formula to Make a decreasing sequence in Excel

Force a two-dimensional sequence to move vertically top to bottom

When populating a range of cells with sequential numbers, by default, the series always goes horizontally across the first row and then down to the next row, just like reading a book from left to right. To get it to propagate vertically, i.e. top to bottom across the first column and then right to the next column, nest SEQUENCE in the TRANSPOSE function. Please note that TRANSPOSE swaps rows and columns, so you should specify them in the reverse order:

TRANSPOSE(SEQUENCE(columns, rows, start, step))

For example, to fill 5 rows and 3 columns with sequential numbers starting at 100 and incremented by 10, the formula takes this form:

=TRANSPOSE(SEQUENCE(3, 5, 100, 10))

To better understand the approach, please have a look at the screenshot below. Here, we input all the parameters in separate cells (E1:E4) and create 2 sequences with the below formulas. Please pay attention rows and columns are supplied in different order!

Sequence that moves vertically top to bottom (row-wise):

=TRANSPOSE(SEQUENCE(E2, E1, E3, E4))

Regular sequence that moves horizontally left to right (column-wise):

=SEQUENCE(E1, E2, E3, E4)
A formula to generate a two-dimensional sequence that moves vertically

Create a sequence of Roman numbers

Need a Roman number sequence for some task, or just for fun? That's easy! Build a regular SEQUENCE formula and warp it in the ROMAN function. For example:

=ROMAN(SEQUENCE(B1, B2, B3, B4))

Where B1 is the number of rows, B2 is the number of columns, B3 is the start number and B4 is the step.
Creating a sequence of Roman numbers

Generate an increasing or decreasing sequence of random numbers

As you probably know, in new Excel there is a special function for generating random numbers, RANDARRAY, which we discussed a few articles ago. This function can do a lot of useful things, but in our case it cannot help. To generate either an ascending or descending series of random whole numbers, we'll be needing the good old RANDBETWEEN function for the step argument of SEQUENCE.

For example, to create a series of increasing random numbers that spills in as many rows and columns as specified in B1 and B2, respectively, and start at the integer in B3, the formula goes as follows:

=SEQUENCE(B1, B2, B3, RANDBETWEEN(1, 10))

Depending on whether you want a smaller or bigger step, supply a lower or higher number for the second argument of RANDBETWEEN.
Formula to generate a series of increasing random integers

To make a sequence of decreasing random numbers, the step should be negative, so you put the minus sign before the RANDBETWEEN function:

=SEQUENCE(B1, B2, B3, -RANDBETWEEN(1, 10))
Formula to create a series of decreasing random integers

Note. Because the Excel RANDBETWEEN function is volatile, it will generate new random values with every change in your worksheet. As the result, your sequence of random numbers will be continuously changing. To prevent this from happening, you can use Excel's Paste Special > Values feature to replace formulas with values.

Excel SEQUENCE function missing

Like any other dynamic array function, SEQUENCE is only available in Excel for Microsoft 365 and Excel 2021 that support dynamic arrays. You won't find it in pre-dynamic Excel 2019, Excel 2016, and lower.

That's how to create sequence in Excel with formulas. I hope the examples were both useful and fun. Anyway, thank you for reading and hope to see you on our blog next week!

Practice workbook for download

Excel SEQUENCE formula examples (.xlsx file)

399 comments

  1. I want to put in column value 1,2,3,4 then down row i want 5,6,7,8
    For exp.-
    1,2,3,4,
    5,6,7,8
    9,10,11,12

  2. NC000001
    NC000002
    NC000003
    NC000004
    NC000005
    NC000006

    Hello sir, how do I make this in sequence in 500 times

    • Hi! If you read the comments below, you will find several answers to your question. Create a sequence of numbers, add leading zeros using the TEXT function and combine with a text string.
      For the detailed instructions, please see: Add leading zeros to numbers.
      Based on this information, the formula could be as follows:

      ="NC"&TEXT(SEQUENCE(500,1,1,1),"000000")

  3. I have a lot of difficulty doing something. I would like to calculate the cusum of a variable bunch of row automatically. To do so, I tried to create a sequence based on every previous value of the same sequence and another value on tha actual row (because the cusum is the sum of the gap with average). Is there a way to put something for the "step" argument of the sequence function so it takes relative reference from every item in itself ? Otherwise, How could I calculate the Cusum of an array into another array dynamically ? Thanks a lot !

    • Sorry, I do not fully understand the task. To understand what you want to do, give an example of the source data and the expected result.

  4. Hi,
    could You help me sequence every text/number in a row for 31 times each of them in single colomn
    ex.
    230502234
    221101338
    221101344
    230502203
    230702549

    thanks in advance

    • Hi! If there is a pattern in your numbers, describe it. I don't see any such pattern, and I don't understand what it is you are trying to do.

      • every data (text/number) in a row Column A should be generate 31 times to a single column every text/number to column B

        Column A Column B
        230502234 ----> 31 times
        221101338 ----> 31 times
        221101344 ----> 31 times
        230502203 ----> 31 times
        230702549 ----> 31 times

        230502234
        230502234
        230502234
        230502234
        221101338
        221101338
        221101338
        221101338
        221101344
        221101344
        221101344
        221101344

        and so on

        • Hi! To repeat a number many times, use a step of zero. Since your numbers have no pattern, you need to create a separate SEQUENCE formula for each number. For example:

          =SEQUENCE(31,1,230502234,0)

  5. Hello sir plz solve this problem in excel formula

    1
    1
    1
    1
    2
    2
    2
    2
    3
    3
    3
    3
    4
    4
    4
    5
    5
    5
    5

    is there a way to do this in excel? thanks

  6. Hi i am having trouble trying to perform the task i want.

    i have the sequence formula here "=SEQUENCE(1,B10, C6, 1)" where B10 is the total number of days and C6 is the start date 29/05/2022.

    my sequence currently is 29/05/2022, 30/05/2022, 31/05/2022 etc

    but i want to make my sequence like this 29/05/2022, 29/05/2022, 29/05/2022, 29/05/2022, 29/05/2022, 29/05/2022 , 30/05/2022, 30/05/2022, 30/05/2022, 30/05/2022, 30/05/2022, 30/05/2022 etc.

    So the dates repeat 6 times before moving forward. Is it possible?

  7. Hello sir plz solve this problem in excel formula

    1
    1
    1
    1
    2
    2
    2
    2
    3
    3
    3
    3

    is there a way to do this in excel? thanks

    • Hello! To create a sequence of repeating numbers, use the CEILING function along with SEQUENCE and specify the number of repeats in the formula. Please try the following formula:

      =CEILING(SEQUENCE(20,1,1,1)/4,1)

  8. 00-00-98
    00-00-99
    00-01-00

    can i use sequence in this?

  9. Hello

    is there a formula to create numbers in cells for instance put 1 in column A and then in Column B it would put 1-2, then skip a number and put 3-4,6-7,9-10,12-13. trying to set up for custom print pages. and another code to skip 2 pages for instance 1-2,5-6,9-10,13-14,17-18. but would be put in column A 1 and in cell A2 put a 2 there and it would go in sequence like that.

    Thank you
    Kenny

    • Hi! Please re-check the article above since it covers your case. Use the SEQUENCE function to create a sequence of numbers. For example:

      =SEQUENCE(10,1,1,4)

  10. Hello sir plz solve this problem in excel formula

    As a like number one coulum and wants to be A 4789 second number 792
    Etc every cells drag the formula but automatic every number combine .
    A=4
    A=7
    A 8
    A 9
    B 7
    B 9
    B2
    C 6
    C3
    C9
    C2
    E 7
    E 8
    G 1
    G 4

    • To extract each symbol from the text into a separate cell, you can use the MID function. For example:

      =MID(A1,ROW(A1:A20),1)

      I hope it’ll be helpful. If this is not what you wanted, please describe the problem in more detail.

  11. Hi!
    Looking for a formula for a sequence (seems basic but somehow have not been able to figure it out):

    24-1
    24-2
    24-3

    The "24" as in the year, so for next years it would need to be 25, and numbers always start at 1 and could go anywhere from 80 to 150 to end (used to number closed files).

    Any guidance is greatly appreciated.

    • Hi! To repeat 100 times the number 24 and then 100 times the number 25, use this formula:

      =CEILING(SEQUENCE(200,1,1,1)/100,1)+23

      Combine sequences of numbers and text using the CONCATENATE function. For example:

      =CONCATENATE(CEILING(SEQUENCE(200,1,1,1)/100,1)+23,"-",SEQUENCE(200,1,1,1))

      • Thank you so much for your guidance. After trying your formulas and getting the #SPILL! message, I realized that it wasn't going to work on an Excel table, and had to convert it to range (it was the only way the formulas would work, I just don't understand why?).

  12. Hi,
    I'm after some help. I want to create a project reference number in excel The first will read GBP1000M-24 This will be GBP1000 03/24, the next one would read GBP100103/24 or to could be GBP100104/24 and so on....

    Many thanks

    • Hi! Your 4 examples are not a sequence of numbers. If you see a pattern in them, describe it. I suggest you study the above article and comments. You will find many examples. Or describe your problem in detail.

  13. This would be really usual if you could spill into a different column. So if you had a list of 60 names in column B and you wanted to do those in three sets of 20, yould need the spill area to be Column A (Name in B), Column C (Name in D) and Column E (Name in E).

    • Sorry, I have no idea exactly what the task is. To understand what you want to do, give an example of the source data and the expected result.

  14. Hi Alexander,

    I'm trying to implement a sequence in a set of (same sized) merged cells.
    For this i'm getting a #spill! error.

    Is there any way of implementing a sequence function in a set of merged cells?

    Thanks in advance!

  15. Hi I need to make a number sequence for 500 items.

    1000-7300
    1001-7300
    1002-7300

    is there a way to do this in excel?

  16. Hi, how do I create a sequence just like in my sample
    50-34386-1582 S. 2000

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)