SEQUENCE

Short answer

Generate a 60-month timeline in one cell

SEQUENCE(rows, [columns], [start], [step])
Excel version
2021+
Also searched as
generate month headers, dynamic timeline, period counter, list of months formula, numbers 1 to n

What it returns

SEQUENCE returns a grid of numbers that step evenly from a starting value. SEQUENCE(5) returns 1 to 5 down a column. SEQUENCE(1, 60) returns 1 to 60 across a row. Add a start and a step and it counts from anywhere by anything.

On its own that is a number generator. In a model it is scaffolding. The period counter across the top of a forecast, the month-end dates above it, the year flags below: each one can spill from a single cell whose size is set by an input. Change the term from 60 to 84 and every row driven by it grows 24 columns.

The result is a dynamic array. Other formulas read it through the spill reference, D$8#, so they resize with it.

Arguments that matter

ArgumentRequiredWhat it does
rowsYesHow many rows to return. 1 for a header that runs across.
columnsNoHow many columns. Defaults to 1. For a timeline, this is the term: Inputs!Term.
startNoThe first value. Defaults to 1. Use 0 when feeding EOMONTH or EDATE, so the first period is the start month itself.
stepNoThe increment. Defaults to 1. 3 for quarter offsets, -1 to count down.

Two habits keep it clean. Read rows and columns from input cells, never type them, per no constants inside formulas. And when you want a row, write 1 for rows and put the count in columns. Getting those swapped gives you 60 rows down the side of a tab built to run across.

In a financial model

The play on time runs left to right says periods go across. SEQUENCE is how that row gets built without a drag-fill. One cell holds the period numbers, one holds the dates, and both resize from the term input.

The dates come from EOMONTH. EOMONTH(Start, SEQUENCE(1, Term, 0)) returns the end of the start month, then the end of each month after it. Month-end is the house convention, and EOMONTH does not drift the way stepping 31 January forward with EDATE does (28 February, then 28 March). The headers are real dates, as date headers are real dates requires, so SUMIFS can bound periods against them and formats can display them as Jan-26.

Everything below the header reads it. A SUMIFS pulling actuals uses D$10# as its date criterion and spills across. A flag row tests YEAR(D$10#)=2027. A debt schedule computes interest per period from the period count in row 8. When the term changes, all of it follows.

For a schedule that also runs on other tabs, put the timeline on one tab and reference it from the rest. The play on anchor rows match across tabs keeps the header row in the same place everywhere, so Timeline!D$10# means the same thing on every sheet.

Worked example

An inputs tab with Start = 1 Jan 2026 and Term = 60, both named cells. A schedule tab Debt with the timeline in rows 8 and 10 from column D.

The period counter in D8:

=SEQUENCE(1, Term)

The month-end dates in D10:

=EOMONTH(Start, SEQUENCE(1, Term, 0))
CellDEF…BK
Row 8, period123…60
Row 10, month-end31-Jan-2628-Feb-2631-Mar-26…31-Dec-30

Two formulas, sixty columns. Set Term to 84 and both rows extend to column CI.

A repayment row reads the counter. With Principal and a Grace input of 12 interest-only months, straight-line repayment of the loan over the remaining periods, in D20:

=IF(D8# > Grace, Principal / (Term - Grace), 0)

Periods 1 to 12 read zero, periods 13 to 60 each repay one forty-eighth. Change Grace or Term and the row reshapes itself.

And actuals by month, reading the header, in D30:

=SUMIFS(GL[Amount], GL[Line], $B30, GL[Date], ">="&(D10# - DAY(D10#) + 1), GL[Date], "<"&(D10# + 1))

One formula per line item, spilling across the full term. The lower bound is the first of the month: a month-end less its own day number, plus one. EOMONTH(D10#,-1)+1 reads more naturally but returns #VALUE! when handed a spill or range reference, so the DAY version is the safe one here. The upper bound is the day after this month-end, so timestamped ledger rows still land in the right period.

Old way vs new way

The legacy timeline is a typed first month-end and a formula dragged across sixty columns:

=EOMONTH(D10, 1)

The new version, in one cell:

=EOMONTH(Start, SEQUENCE(1, Term, 0))

The dragged version has a fixed width. Extend the term and someone has to drag it further, and every row below it, and the gap goes unnoticed until a total comes up short. The SEQUENCE version reads its width from the input.

Where it breaks

The timeline runs down the side instead of across. The term went into rows. Fix: SEQUENCE(1, Term), with 1 for rows and the count in columns.

The first month is missing: the timeline starts in February. start was left at its default of 1, so EOMONTH returned the end of the month after the start for the first period. Fix: pass 0 as start when feeding EOMONTH.

The dates show as five-digit numbers. EOMONTH returns date serials and the spill took the cell’s General format. Fix: format the header row as a date, mmm-yy, once. The format applies across the spill.

SEQUENCE returns #SPILL!. A hard-coded value or an old dragged formula sits somewhere in the path. The longer term needs columns that are not empty. Fix: clear the row to the right of the anchor cell, then let the spill fill it.

SEQUENCE returns #VALUE! or #CALC!. The term input is blank, zero, negative or text. Fix: bound the input with data validation, per the play on bound every driver, so a blank term cannot reach the formula.

Formulas below stop at the old width. They reference D10:BK10 instead of the spill, D10#, so they do not extend when the term grows. Fix: reference the spill range everywhere the timeline is read.

SEQUENCE returns #NAME?. The file opened in Excel 2019 or earlier. Fix: if the model must travel, keep a dragged EOMONTH row sized to the longest term you expect.

Related functions

  • SUMIFS. Reads the spilled header as its date criteria, so actuals extend with the timeline.
  • TAKE. Pull the last twelve periods out of the timeline for an LTM column.
  • SCAN. A running balance across the spilled periods, for the closing debt balance row.
  • LET. Name the timeline once inside a long schedule formula instead of rebuilding it.
  • TOCOL. Turn a spilled period grid into a list when a database load needs one row per period.
  • EDATE and EOMONTH. The date arithmetic SEQUENCE feeds. EDATE steps months from a start date, EOMONTH snaps to month end.

All functions