SEQUENCE Function in Excel

Sumit Bansal
Written by

Sumit Bansal is the founder of TrumpExcel.com and a 13-time Microsoft Excel MVP. He started this site in 2013 to share his passion for Excel through easy tutorials, tips, and training videos, helping you master Excel, boost productivity, and maybe even enjoy spreadsheets!

Last updated

Excel’s SEQUENCE function is one of those features that might seem simple at first glance, but when you start combining it with other functions, that’s when the real magic happens.

SEQUENCE function does one straightforward thing on its own: it gives you a sequence of numbers.

But trust me, once you see what it can do when paired with other Excel functions, you’ll wonder how you ever managed without it.

In this article, I’m going to walk you through everything you need to know about the SEQUENCE function, including some awesome examples.

Follow along with the example file

SEQUENCE Function Examples.xlsx

Download

Understanding the SEQUENCE Function Syntax

The SEQUENCE function takes four arguments, but you don’t need to use all of them.

Let’s break down each parameter:

=SEQUENCE(rows, [columns], [start], [step])
  • Rows (Required): The number of rows to return. You can leave it empty, as in =SEQUENCE(,10), when you provide at least one other argument.
  • Columns (Optional): The number of columns to return. Defaults to 1 if omitted.
  • Start (Optional): The starting value. Defaults to 1 if omitted.
  • Step (Optional): The increment between values. Defaults to 1 if omitted.

Using SEQUENCE Function in Excel

If you enter the following formula in a cell, you’ll get numbers 1 through 10 in a single column. The function always starts with 1 and increments by 1 unless you specify otherwise.

=SEQUENCE(10)
SEQUENCE Function Excel

Want those numbers in a row instead? Use the below formula:

=SEQUENCE(,10)
Sequence function to fill in different columns

Notice how I left the first argument (rows) empty and put 10 in the columns position. This tells Excel that I do not need the 10 numbers in different rows but rather I want them in different columns, which puts them in one single row.

If you want to fill a grid of rows and columns that has a sequence of numbers, you can use a formula as shown below.

=SEQUENCE(10,10)

This creates a 10×10 grid where numbers increment horizontally across each row.

Sequence function giving a grid of ten rows and ten columns

Pro tip: If you want the increment to happen down the column instead of across the row, wrap your SEQUENCE function in TRANSPOSE:
=TRANSPOSE(SEQUENCE(10,10))

Changing the Start Value

By default, the SEQUENCE function will start the numbering from one, but if you want, you can change the start value by specifying that in the third argument of the function.

For example, if I want the numbering to start from 5, then I can use the below formula.

=SEQUENCE(10,,5)
Sequence function with a start value

This formula gives me a sequence of 10 numbers, starting from 5 and going up to 14.

Changing the Step Value

You can also change the step value, which is the difference between each value generated by the SEQUENCE function.

By default, this value is 1. You can change this by specifying it as the fourth argument of the function.

Below is the function that generates ten numbers starting from 1, where the step value is 2.

=SEQUENCE(10,,,2)
Sequence function with a step value

Follow along with the example file

SEQUENCE Function Examples.xlsx

Download

Practical Examples of Using SEQUENCE Function in Excel

Here are eight practical examples of using the SEQUENCE function.

Example 1: Creating Date Sequences

The most common real-life use case of using the SEQUENCE function in Excel is to generate dates.

To do this, we can combine this function with the TODAY function in Excel.

Getting Dates of 30 days starting from Today

Below is the formula that will give you a list of 30 days starting from the current date.

=SEQUENCE(30,,TODAY())
Getting 30 consecutive dates from today

This formula creates a list of 30 consecutive dates starting from today. The beauty is that it updates when Excel recalculates.

In case you want to start from a specific date, you can replace the TODAY function with the DATE function where you can specify the day, month, and year values.

For example, if I want a series of 30 dates starting from 1st January 2026, then I can use the below function.

=SEQUENCE(30,,DATE(2026,1,1))
Get 30 consecutive days dates from a specified date

Getting Alternate Dates

To get a sequence of alternate dates, you can specify the step value as 2.

This would ensure that there is a gap of two days in between every date returned by the SEQUENCE function.

=SEQUENCE(30,,TODAY(),2)
Setting the step value in the sequence function

Repeating Every Date Given Number of Times

If you want to repeat dates, then you can again use a fractional step value, 1/n, where n is the number of times you want to repeat every date.

For example, if I want to get a list of 30 rows containing 10 dates, where every date repeats three times, then I can use the below formula.

=ROUNDDOWN(SEQUENCE(30,,TODAY(),1/3),0)
Repeating dates using the sequence function

This repeats each date three times, which can be useful for scheduling scenarios.

Since dates are stored as whole numbers in the backend in Excel, when I use a step value that of 1/3, it would only become a whole number on every third date, and this is why every date is going to repeat three times.

Example 2: Get a List of Working Days Only

Here’s where it gets really interesting.

If you want to get a list of all the working days while skipping the weekends, then you can use the below formula (considering that weekend here means Saturday and Sunday).

=WORKDAY.INTL(TODAY()-1,SEQUENCE(30),1)
Get a list of working days

WORKDAY.INTL function in Excel gives us a working day date when we specify the start date and the number of days after the start date.

In the above example, instead of giving it one date as the second argument, I gave it SEQUENCE(30), which would generate a list of 30 numbers ({1,2,3…..30}).

So, instead of giving me the result as one single date, it would give me a list of 30 dates starting on or after today, ensuring that these are all working days that do not include Saturdays and Sundays.

The 1 as the last argument means that the weekend days would be Saturday and Sunday. If you want any other day to be considered as the weekend day, then you can choose from many options available in the drop-down for the last argument.

Now, what if I have a list of holidays and I want to ensure that the dates that are given to me do not include weekend days as well as any of the holidays.

Thankfully, that can also be taken care of by the WORKDAY.INTL function.

Below is the formula that gives me 30 working days on or after May 26, 2025, skipping Saturdays, Sundays, and the holidays listed in D2:D12.

=WORKDAY.INTL(DATE(2025,5,26)-1,SEQUENCE(30),1,D2:D12)
WORKDAY.INTL and SEQUENCE show the first 17 working dates starting May 27, 2025, beside the complete holiday list in D2:D12. Later dates continue beyond the torn bottom edge.

Example 3: Custom Working Days (Tuesdays and Thursdays Only)

If you want a list of dates that only include specific weekdays, such as only Mondays or only Tuesdays and Thursdays, then that can also be done using the WORKDAY.INTL function along with the SEQUENCE function.

Below is the formula that will give me a list of 30 days starting on or after today that only include Tuesdays and Thursdays.

=WORKDAY.INTL(TODAY()-1,SEQUENCE(30),"1010111")
Get a list of specific working days

The trick here is in the last argument, where we have manually specified which days are working days and which days are non-working days.

The seven-digit string represents each day of the week (Monday through Sunday), where 1 = non-working day and 0 = working day. So “1010111” gives you only Tuesdays and Thursdays.

Example 4: Time Slot Generation

Below is the formula that would generate a list of time values with an interval of 30 minutes between them starting from 8 AM.

=SEQUENCE(30,,TIME(8,0,0),TIME(0,30,0))
Get a list of time slots

Just format the cells as time, and you have an instant schedule.

Example 5: Extract Every Nth Row

You can use the sequence function within the filter function to extract every second or third or fourth record from a dataset.

Below I have a data set from which I want to extract every third record.

Filter every nth row with Filter and Sequence

Here is the formula that will do this.

=FILTER(A2:C13,MOD(SEQUENCE(ROWS(A2:C13)),3)=0)

This formula:

  • Uses SEQUENCE to create numbers matching your data range
  • Applies the MOD function to get an array of TRUEs and FALSEs where every third value is TRUE.
  • Uses FILTER function to extract only those records

Change the 3 to any number to extract the records with that interval.

Follow along with the example file

SEQUENCE Function Examples.xlsx

Download

Example 6: Sum of Top N Values

Below I have a dataset and I want to get the sum of top three values from the sales column.

Here is the formula that will do this.

=SUM(LARGE(C2:C13,SEQUENCE(E2)))
SUM top N large values using sequence

With 3 in E2, SEQUENCE(E2) returns {1,2,3}. The LARGE function uses these ranks to extract the three largest values from the sales column.

This makes the LARGE function return the three largest values from the column. And then the SUM function is used to add these three values and give us the sum.

You can change the number in E2 and the formula will give you the sum of that many values, up to the number of sales values in C2:C13.

Example 7: Repeat Data Patterns

If you have a list of items or list of names and you want to repeat them any given number of times, I’ll show you how to do that using a formula that includes the SEQUENCE function.

Below I have this dataset of team names and I want to repeat these team names five times.

Important: This formula assumes the team names in A2:A6 start in A2 and have no blank cells between them.

COUNTA skips empty cells, but INDEX still uses row positions. A blank in the middle can make the formula repeat an empty position and omit a trailing name.

Here is the formula that will do that.

=INDEX(A2:A6,MOD(SEQUENCE(COUNTA(A2:A6)*5,,0),COUNTA(A2:A6))+1)
Repeat Lists using Sequence

This formula:

  • Counts your team names using COUNTA(A2:A6)
  • Multiplies by how many times you want to repeat (5 in this example)
  • Uses MOD to create the repeating pattern
  • Uses INDEX to retrieve the actual team names
Also read: Repeat Rows N Times in Excel

Example 8: Dynamic Calendar Creation

You can create a complete calendar with one formula that uses SEQUENCE.

Below is the formula that will do that.

=LET(
    monthFirstDay, DATE(B2,B1,1),
    startDayShift, WEEKDAY(monthFirstDay,2)-1,
    startDateCalendar, monthFirstDay-startDayShift,
    SEQUENCE(6,7,startDateCalendar,1)
)
SEQUENCE calendar for May 2025 showing 42 dates in A5:G10, from April 28 through June 8.

In the above formula, you have to provide the month number in B1 and the year in B2, which is then used to create the entire calendar.

Now this would be very difficult to do without the sequence function because the sequence function allows us to quickly create a grid of six rows and seven columns and then also allows us to specify the start date for the calendar.

Important: The formula fills all 42 cells in a six-week grid. Dates from the previous and next month can appear in the calendar.

With 5 in B1 and 2025 in B2, the dates run from April 28 through June 8, 2025.

SEQUENCE Function Availability and Common Errors

SEQUENCE works in Excel for Microsoft 365 (Windows and Mac), Excel 2024, Excel 2021, Excel for the web, and the mobile apps for iPhone, iPad and Android.

Excel 2019, 2016 and older return #NAME? when you type SEQUENCE. Opening a file from a newer version shows the formula with an _xlfn. prefix, such as _xlfn.SEQUENCE.

SEQUENCE needs empty cells for its whole output. If something blocks the spill range, you’ll get #SPILL!. Clear or move whatever is in the way.

Some Tips When Using the SEQUENCE Function for Maximum Impact

  1. Combine with other functions: SEQUENCE rarely works alone. Its power comes from combination with FILTER, INDEX, WORKDAY.INTL, and others.
  2. Think in arrays: Remember that SEQUENCE creates arrays, so pair it with functions that can handle arrays.
  3. Choose the step for your schedule: Use 2 for alternate dates or TIME(0,30,0) for 30-minute time slots.

Start experimenting with these examples, and you’ll quickly discover that the SEQUENCE function is an indispensable tool in your Excel arsenal.

The beauty lies not just in what it does, but in how it enables other functions to perform at their best.

I hope you found this article helpful. In case you have any comments or feedback, do let me know in the comment section.

Other Excel articles you may also like:

Sumit Bansal

Sumit Bansal

13x Microsoft Excel MVP

Hey! I'm Sumit Bansal, founder of trumpexcel.com and a Microsoft Excel MVP. I started this site in 2013 because I genuinely love Microsoft Excel (yes, really!) and wanted to share that passion through easy Excel tutorials, tips, and Excel training videos. My goal is straightforward: help you master Excel skills so you can work smarter, boost productivity, and maybe even enjoy spreadsheets along the way!

Get the FREE 51 Excel Tips Ebook

Enter your details and the free PDF is on its way to your inbox.

Hmm, that didn't go through. Please check your email and try again.

No spam. You'll also get my weekly Excel newsletter. Unsubscribe anytime.

Check your inbox!

The ebook is on its way to your email. It usually lands within a couple of minutes.