Available in:Excel 2021 or later (Works in Excel 2021, every later version, Microsoft 365 and Excel for the web)Category:Dynamic arrays

SEQUENCE

REEKS in Dutch Excel

Builds a block of consecutive numbers with a start value and a step, which spills into as many rows and columns as you ask for.

Difficulty rating 3 of 5. The function is short, but you must think in blocks: rows and columns decide the shape, and the result only becomes useful once it feeds another function such as EDATE, INDEX or SUMIFS.

Last updated: 13 October 2026

See the worked examples

Sheet excerpt: D2 holds the formula
RowABCD
1CustomerBalanceNo.
2Van Dijk Transport BV€48,250.00€ 48.250,0011=SEQUENCE(5)=SEQUENCE(5)
3Hendriks Metaal BV€31,900.00€ 31.900,0022
4Smits Bouw BV€22,475.00€ 22.475,0033
5Mulder Horeca BV€15,120.00€ 15.120,0044
6Kaya Design BV€9,860.00€ 9.860,0055
Formula cell (D2)InputSpilled result
=SEQUENCE(5)
=SEQUENCE(5)

What SEQUENCE does and when to use it

What it does: it creates a block of numbers from one formula, for example line numbers 1 to 25 or the month offsets 0 to 11.

When to use it: when a formula needs a list of numbers to feed to another function, such as EDATE for a run of months or INDEX for every third line, or when you number a list that grows or shrinks. It replaces dragging a fill handle. For one number or a fixed header, typing the value is clearer.

Two main gains:

  • One formula, whole block: you set height, width, first number and step, and the spill fills the cells. No fill handle to drag.
  • Follows your data: make rows depend on the list, for example with COUNTA, and the numbering stays right when the list grows.

How Excel evaluates it

Excel reads rows and columns and reserves a block of that size, starting at the formula cell. It puts start in the top left cell. It then fills the block row by row, from left to right, and after each cell adds step: in a block of 2 rows and 3 columns with defaults, the first row holds 1, 2, 3 and the second row 4, 5, 6.

Leave out columns, start or step and Excel uses 1 for each. If a cell in the block is already occupied, the result is #SPILL!.

Watch out: In Excel 2019 or earlier SEQUENCE shows #NAME?.

Mental model

A fill handle that you control by numbers: you say how far to drag, in which directions, where to start and how big each step is.

Terms used on this page: spill, cell

SEQUENCE(rows, [columns], [start], [step])
SEQUENCE(rows; [columns]; [start]; [step])
Arguments
ArgumentTypeMeaningDefault
rowsRequiredHow many rows the block has.
columnsOptionalHow many columns; default 1.1
startOptionalThe first number; default 1.1
stepOptionalThe increment between numbers; default 1.1

Return value:A block of numbers, rows tall and columns wide, filled row by row

Formulas use commas (,) between arguments, as in English Excel. Formulas use semicolons (;) between arguments, as in Dutch Excel. Formulas use commas (,) between arguments, as in English Excel; Dutch Excel uses semicolons (;).

Worked examples

Beginner

Number the lines of a confirmation list

At Veldhuis Installatie BV you have picked five customers from the receivables list for balance confirmations. Your workpaper needs a reference number per line, so letters and replies can be tied back to the list. You want the numbers to come from a formula, not from typing.

Sheet excerpt: D2 holds the formula
RowABCDE
1CustomerBalanceNo.
2Van Dijk Transport BV€48,250.00€ 48.250,0011=SEQUENCE(5)=SEQUENCE(5)
3Hendriks Metaal BV€31,900.00€ 31.900,0022
4Smits Bouw BV€22,475.00€ 22.475,0033
5Mulder Horeca BV€15,120.00€ 15.120,0044
6Kaya Design BV€9,860.00€ 9.860,0055
7
Formula cell (D2)InputSpilled result

Formula in D2

=SEQUENCE(5)
=SEQUENCE(5)

Result: 1 / 2 / 3 / 4 / 51 / 2 / 3 / 4 / 5

Step by step
  1. The formula has one argument: rows is 5. The arguments columns, start and step are left out, so each is 1.
  2. Excel reserves a block 5 rows tall and 1 column wide, starting at D2: the cells D2 to D6.
  3. The top cell gets start, which is 1. Each next cell adds step, which is 1: 1, then 1+1=2, then 3, 4 and 5.
  4. The numbers 1 to 5 spill down D2:D6, next to the five customers in rows 2 to 6: 1 beside Van Dijk Transport BV (48,250.0048.250,00) and 5 beside Kaya Design BV (9,860.009.860,00).
  5. Change the 5 to 6 and the block grows to D2:D7, with a 6 beside an empty row. The formula follows its argument, not the list, so the number must match the list.

Watch out: If anything is typed in D3:D6, the formula shows #SPILL! instead of the numbers. Keep the cells below the formula empty.

More on this example: why it works, 1 more pitfall, 2 variations

Why it works

With only rows given, SEQUENCE uses its defaults, a start of 1 and a step of 1, which is exactly what a line number needs. The result is a live block: one formula in D2 replaces five typed numbers.

More to watch out for

  • The numbers are not tied to the customers. If you sort the list in A2:B6, the numbers stay 1 to 5 in the same cells and no longer follow the same customer.

Variations

=SEQUENCE(ROWS(A2:A6))
=SEQUENCE(ROWS(A2:A6))

Take the count from the list instead of typing 5, so the numbering adjusts to the range you point at.

=SEQUENCE(1, 5)
=SEQUENCE(1; 5)

The same five numbers across a row, for column headers.

Intermediate

Positions for a systematic sample of invoices

You test eight purchase invoices of Veldhuis Installatie BV with a systematic sample: a fixed interval after a first position. You type the first position and the interval in F1 and F2, and want the three positions to appear, so you can pick those lines from the list. The positions must stay within the 8 lines of the list.

Sheet excerpt: E3 holds the formula
RowABCDEFG
1InvoiceAmountFirst position22
225-2001€1,210.00€ 1.210,00Interval33
325-2002€3,025.00€ 3.025,0022=SEQUENCE(3, 1, F1, F2)=SEQUENCE(3; 1; F1; F2)
425-2003€8,470.00€ 8.470,0055
525-2004€605.00€ 605,0088
625-2005€12,100.00€ 12.100,00
725-2006€2,420.00€ 2.420,00
825-2007€6,050.00€ 6.050,00
925-2008€15,125.00€ 15.125,00
10
Formula cell (E3)InputSpilled result

Formula in E3

=SEQUENCE(3, 1, F1, F2)
=SEQUENCE(3; 1; F1; F2)

Result: 2 / 5 / 82 / 5 / 8

Step by step
  1. F1 holds 2 and F2 holds 3. So rows is 3, columns is 1, start is 2 and step is 3.
  2. Excel reserves a block of 3 rows and 1 column from E3 down to E5.
  3. The first cell gets start: 2. The second adds the step: 2+3=5. The third adds it again: 5+3=8.
  4. The positions count within the list, not the sheet rows. Position 2 is invoice 25-2002 (3,025.003.025,00), position 5 is 25-2005 (12,100.0012.100,00) and position 8 is 25-2008 (15,125.0015.125,00), which sit in sheet rows 3, 6 and 9.
  5. Change F2 to 4 and the positions become 2, 6 and 2+4+4=10. Position 10 does not exist in a list of 8 lines, so the sample would not fit.

Watch out: Nothing checks that the last position fits the list. Start 2, step 3 and 4 items would end at 11 in a list of 8 lines. Check that start + (n-1) × step is at most the number of lines.

More on this example: why it works, 1 more pitfall, 2 variations

Why it works

start and step turn the counter into an arithmetic series: position n is start + (n-1) × step. That is exactly the rule of a systematic sample, and because both values sit in cells, you change the sample by retyping two numbers.

More to watch out for

  • A decimal in F1 or F2, such as 2.5, gives decimal positions that INDEX cuts off to whole numbers, so the lines you pick are not the ones the sample rule describes.

Variations

=INDEX(A2:A9, SEQUENCE(3, 1, F1, F2))
=INDEX(A2:A9; SEQUENCE(3; 1; F1; F2))

Go one step further and return the invoice numbers themselves: 25-2002, 25-2005 and 25-2008.

=SEQUENCE(3, 1, 8, -3)
=SEQUENCE(3; 1; 8; -3)

Count down from the last line with a negative step: 8, 5, 2.

Advanced

Revenue per month for a cut-off table

For the revenue analysis of Molenaar Bouw BV you have the postings on account 8000 for the first months of 2025. You want one total per month for January to April, without a helper column and without typing month boundaries.

The first day of the period sits in F1. A posting from May is in the list too, and should not be counted.

Sheet excerpt: E3 holds the formula
RowABCDEFG
1DateAmountPeriod start1 Jan 2025
214 Jan 2025€12,000.00€ 12.000,00
329 Jan 2025€8,500.00€ 8.500,00€20,500.00€ 20.500,00=SUMIFS(B2:B9, A2:A9, ">="&EDATE(F1, SEQUENCE(4, 1, 0)), A2:A9, "<"&EDATE(F1, SEQUENCE(4, 1, 1)))=SUMIFS(B2:B9; A2:A9; ">="&EDATE(F1; SEQUENCE(4; 1; 0)); A2:A9; "<"&EDATE(F1; SEQUENCE(4; 1; 1)))
410 Feb 2025€15,250.00€ 15.250,00€25,000.00€ 25.000,00
527 Feb 2025€9,750.00€ 9.750,00€17,400.00€ 17.400,00
65 Mar 2025€11,000.00€ 11.000,00€7,300.00€ 7.300,00
731 Mar 2025€6,400.00€ 6.400,00
82 Apr 2025€7,300.00€ 7.300,00
92 May 2025€5,150.00€ 5.150,00
10
Formula cell (E3)InputSpilled result

Formula in E3

=SUMIFS(B2:B9, A2:A9, ">="&EDATE(F1, SEQUENCE(4, 1, 0)), A2:A9, "<"&EDATE(F1, SEQUENCE(4, 1, 1)))
=SUMIFS(B2:B9; A2:A9; ">="&EDATE(F1; SEQUENCE(4; 1; 0)); A2:A9; "<"&EDATE(F1; SEQUENCE(4; 1; 1)))

Result: €20,500.00 / €25,000.00 / €17,400.00 / €7,300.00€ 20.500,00 / € 25.000,00 / € 17.400,00 / € 7.300,00

Step by step
  1. F1 is 1 January 2025, serial number 45658. The two SEQUENCE calls come first. SEQUENCE(4, 1, 0) gives 0, 1, 2, 3 and SEQUENCE(4, 1, 1) gives 1, 2, 3, 4.
  2. EDATE moves F1 by each of those months. With 0, 1, 2, 3 it returns the first of January, February, March and April: 45658, 45689, 45717, 45748. With 1, 2, 3, 4 it returns the first of the next month each time: 45689, 45717, 45748, 45778 (1 May).
  3. The & joins the operator to each number, so the criteria are ">=45658", ">=45689", ">=45717", ">=45748" for the first test and "<45689", "<45717", "<45748", "<45778" for the second. Each month is a pair: on or after its first day and before the first day of the next month.
  4. SUMIFS runs once per pair:

    • January: 14 and 29 January, 12,00012.000 + 8,5008.500 = 20,50020.500
    • February: 15,25015.250 + 9,7509.750 = 25,00025.000
    • March: 11,00011.000 + 6,4006.400 = 17,40017.400, and 31 March counts because it is before 1 April
    • April: 7,3007.300
  5. The four totals spill down E3:E6. The posting of 2 May (5,1505.150) falls in no pair: 20,50020.500 + 25,00025.000 + 17,40017.400 + 7,3007.300 = 70,20070.200, while B2:B9 adds up to 75,35075.350. The difference of 5,1505.150 is exactly that posting.

Watch out: The count 4 is typed twice. If you change one SEQUENCE to 5 and forget the other, the two criteria arrays have different sizes and the result is wrong or an error. Take the count from one cell instead.

More on this example: why it works, 1 more pitfall, 2 variations

Why it works

SEQUENCE supplies the month offsets, EDATE turns each offset into a date, and SUMIFS accepts an array as criteria and returns one answer per element. The sum range and both criteria ranges stay fixed, while the criteria change per row of the spill, so a table that used to need a helper column becomes one formula.

More to watch out for

  • Silent error: with SEQUENCE(4, ...) the May posting is dropped without any message, and the table is 5,1505.150 short of the ledger. Always compare the sum of the table with the total of the source.

Variations

=EDATE(F1, SEQUENCE(4, 1, 0))
=EDATE(F1; SEQUENCE(4; 1; 0))

The month column itself, to place beside the totals: 1 Jan, 1 Feb, 1 Mar and 1 Apr 2025. Format the cells as dates.

=SUMIFS(B2:B9, A2:A9, ">="&F1, A2:A9, "<"&EDATE(F1, 4))
=SUMIFS(B2:B9; A2:A9; ">="&F1; A2:A9; "<"&EDATE(F1; 4))

One total for the whole period January to April (70,20070.200), as a quick check on the monthly figures.

Master

Purchases per month in a quarter grid, reconciled

Hendriks Metaal BV has a broken fiscal year from 1 July 2025 to 30 June 2026. For your analytical review you want purchases per month in a grid of four quarters (rows) by three months (columns). The grid must name its steps for the reviewer and must refuse to show numbers that do not add up to the ledger, for example when a posting falls outside the fiscal year.

Sheet excerpt: E3 holds the formula
RowABCDEFGH
1EntryDateAmountFiscal year start1 Jul 2025
225-31018 Jul 2025€4,200.00€ 4.200,00
325-310219 Aug 2025€6,800.00€ 6.800,00€4,200.00€ 4.200,00=LET( fyStart, F1, offsets, SEQUENCE(4, 3, 0), monthStart, EDATE(fyStart, offsets), nextMonth, EDATE(fyStart, offsets + 1), totals, SUMIFS(C2:C9, B2:B9, ">="&monthStart, B2:B9, "<"&nextMonth), IF(SUM(totals) = SUM(C2:C9), totals, "Postings outside the fiscal year") )=LET( fyStart; F1; offsets; SEQUENCE(4; 3; 0); monthStart; EDATE(fyStart; offsets); nextMonth; EDATE(fyStart; offsets + 1); totals; SUMIFS(C2:C9; B2:B9; ">="&monthStart; B2:B9; "<"&nextMonth); IF(SUM(totals) = SUM(C2:C9); totals; "Postings outside the fiscal year") )€8,150.00€ 8.150,00€0.00€ 0,00
425-310327 Aug 2025€1,350.00€ 1.350,00€9,100.00€ 9.100,00€0.00€ 0,00€2,750.00€ 2.750,00
525-310414 Oct 2025€9,100.00€ 9.100,00€5,600.00€ 5.600,00€0.00€ 0,00€0.00€ 0,00
625-310530 Dec 2025€2,750.00€ 2.750,00€3,900.00€ 3.900,00€0.00€ 0,00€8,250.00€ 8.250,00
726-310612 Jan 2026€5,600.00€ 5.600,00
826-31077 Apr 2026€3,900.00€ 3.900,00
926-310830 Jun 2026€8,250.00€ 8.250,00
10
Formula cell (E3)InputSpilled result

Formula in E3

=LET(
  fyStart, F1,
  offsets, SEQUENCE(4, 3, 0),
  monthStart, EDATE(fyStart, offsets),
  nextMonth, EDATE(fyStart, offsets + 1),
  totals, SUMIFS(C2:C9, B2:B9, ">="&monthStart, B2:B9, "<"&nextMonth),
  IF(SUM(totals) = SUM(C2:C9), totals, "Postings outside the fiscal year")
)
=LET(
  fyStart; F1;
  offsets; SEQUENCE(4; 3; 0);
  monthStart; EDATE(fyStart; offsets);
  nextMonth; EDATE(fyStart; offsets + 1);
  totals; SUMIFS(C2:C9; B2:B9; ">="&monthStart; B2:B9; "<"&nextMonth);
  IF(SUM(totals) = SUM(C2:C9); totals; "Postings outside the fiscal year")
)

Result: €4,200.00 | €8,150.00 | €0.00 / €9,100.00 | €0.00 | €2,750.00 / €5,600.00 | €0.00 | €0.00 / €3,900.00 | €0.00 | €8,250.00€ 4.200,00 | € 8.150,00 | € 0,00 / € 9.100,00 | € 0,00 | € 2.750,00 / € 5.600,00 | € 0,00 | € 0,00 / € 3.900,00 | € 0,00 | € 8.250,00

Step by step
  1. LET stores fyStart as F1: 1 July 2025, serial 45839. Nothing is shown yet.
  2. offsets is SEQUENCE(4, 3, 0): 4 rows by 3 columns, start 0, step 1, filled row by row: 0, 1, 2 then 3, 4, 5 then 6, 7, 8 then 9, 10, 11. Each row is one quarter, each column a month of that quarter.
  3. monthStart is EDATE(fyStart, offsets): the first of July, August, September in row 1, then October to December, January to March, and April to June. nextMonth is the same shifted by one month, so it ends on 1 July 2026. Both are 4 by 3 grids of dates.
  4. totals is SUMIFS over each cell of the grid: postings on or after monthStart and before nextMonth. Per quarter row:

    • July to September: July 4,2004.200, August 6,8006.800 + 1,3501.350 = 8,1508.150, September none, 0
    • October to December: October 9,1009.100, November 0, December 2,7502.750
    • January to March: January 5,6005.600, February and March 0
    • April to June: April 3,9003.900, May 0, June 8,2508.250, because 30 June is before 1 July 2026
  5. The last argument is the result. SUM(totals) is 4,2004.200 + 8,1508.150 + 9,1009.100 + 2,7502.750 + 5,6005.600 + 3,9003.900 + 8,2508.250 = 41,95041.950, and SUM(C2:C9) is also 41,95041.950. They are equal, so IF returns totals.
  6. The grid spills over E3:G6. Move one date to 2 July 2026 and that amount falls outside every month: the sums differ and E3 shows Postings outside the fiscal year instead of a grid that looks complete.

Watch out: The mirror-image mistake is SEQUENCE(3, 4, 0). It still covers twelve months and the reconciliation still passes, but the grid now has 3 rows of 4 months, so rows are no longer quarters and a reader of the headers is misled. Rows come first: 4 quarters, then 3 months.

More on this example: why it works, 2 more pitfalls, 1 variation

Why it works

One SEQUENCE call carries both dimensions, so the month offsets, the month starts, the next month starts and the totals all keep the same 4 by 3 shape, and the grid layout needs no extra formula. The reconciliation at the end ties the grid to the source, so a posting that falls outside the year cannot disappear silently.

Do not use this when:

  • you only need one list of months (a plain SEQUENCE(12) is clearer)
  • the file must open in Excel 2019 or earlier
  • the client will explore the data by quarter and month: a PivotTable with the dates grouped by months and quarters gives the same figures without a formula and reacts to new data on refresh

More to watch out for

  • To debug, replace the last line with one of the names, for example monthStart, and the formula shows that step as a grid of dates. Format the cells as dates, or you see serial numbers.
  • The test SUM(totals) = SUM(C2:C9) can hide two errors that cancel each other out, such as a missing posting and a doubled one of the same amount. For a high-risk account, add a count of postings as well.

Variations

=LET(
  months, EDATE(F1, SEQUENCE(4, 3, 0)),
  SUMIFS(C2:C9, B2:B9, ">="&months, B2:B9, "<"&EDATE(months, 1))
)
=LET(
  months; EDATE(F1; SEQUENCE(4; 3; 0));
  SUMIFS(C2:C9; B2:B9; ">="&months; B2:B9; "<"&EDATE(months; 1))
)

The same grid with two names and no reconciliation: shorter, but a posting outside the year disappears without any message.

Common mistakes

Common mistakes
SymptomCauseFix
Block the wrong way roundYou ask for SEQUENCE(3, 4) but wanted 4 rows and 3 columns, and the block is the wrong way round.The first argument is always the height. Rows come first, then columns, the same order as in INDEX.
Numbers such as 45658, not datesA list of dates built with SEQUENCE shows numbers such as 45658 instead of dates.Dates are serial numbers underneath. Format the spill range as a date, or let a date function such as EDATE produce the values.
List wrong when the source growsThe count is fixed in the formula, SEQUENCE(12), and the list silently stops being right when the source has 13 lines.Take the count from the data, for example SEQUENCE(ROWS(A2:A14)), or reconcile the result with a total, as the Master example does.
#SPILL! although the formula is rightThe result is #SPILL! even though the formula is right.Something sits in the cells the block needs. Click the error, choose Select Obstructing Cells, and clear them.

Used in combinations

  • Split a pasted list into a clean columnSplit a list of invoice numbers pasted into one cell on the commas, strip the stray spaces with TRIM and stack the pieces into one column with TOCOL, ready for matching.Excel 2024 or later (This combination needs Excel 2024 or later)
  • The five largest manual entries with TAKE, SORT and FILTERList the five largest manual (MEM) journal lines for journal entry testing: FILTER keeps the MEM lines, SORT puts the largest amount first and TAKE keeps the first five rows.Excel 2024 or later (This combination needs Excel 2024 or later)
  • Gap test on invoice numbers with FILTER, SEQUENCE and XMATCHFind the missing numbers in a series of sales invoices: SEQUENCE builds every number from the lowest to the highest, XMATCH looks each one up in the ledger, ISNA marks the misses and FILTER lists them, with a message when there are no gaps.Excel 2021 or later (This combination needs Excel 2021 or later)
  • Revenue per month for twelve months in one formulaTotal revenue for each of twelve months with one SUMIFS: SEQUENCE counts the months, EDATE turns each count into the first day of a month, and those dates become the criteria.Excel 2021 or later (This combination needs Excel 2021 or later)
  • Systematic sample of invoices with a fixed startSelect every k-th invoice from a population: the interval comes from ROUNDDOWN and ROWS, SEQUENCE counts the picks from a fixed start typed in a cell, and INDEX lists the selected rows.Excel 2021 or later (This combination needs Excel 2021 or later)