Dynamic arrays

Excel formula for a sequence of dates (SEQUENCE)

SEQUENCE(rows, columns, start, step) generates numbers, and since Excel dates are numbers, it also generates dates.

Excel 365 / Excel 2021+; Google Sheets

The formula

Weekly dates (6 weeks)ExcelGoogle Sheets
=SEQUENCE(6,1,A2,7)
In C2, spills: [Jan 5, 2026], [Jan 12, 2026], [Jan 19, 2026], [Jan 26, 2026], [Feb 2, 2026], [Feb 9, 2026]
Month-end dates (4 months)Excel
=EOMONTH(A2,SEQUENCE(4,1,0))
In E2, spills: [Jan 31, 2026], [Feb 28, 2026], [Mar 31, 2026], [Apr 30, 2026]
Google Sheets month-endsGoogle Sheets
=ARRAYFORMULA(EOMONTH(A2,SEQUENCE(4,1,0)))
In G2, spills: [Jan 31, 2026], [Feb 28, 2026], [Mar 31, 2026], [Apr 30, 2026]
✓ Tested. All 2 Excel results in this example were recalculated in LibreOffice Calc 25.2 and matched the values shown. 1 result for formulas tagged Google Sheets was checked with a reference implementation of the documented behavior, because LibreOffice can't run that function.

Worked example

Paste the data below into a blank sheet starting at cell A1 (or download the cheat sheet, where every example is set up). Highlighted cells hold the formulas and show the expected results.

ABCDEFG
1Start date
2Jan 5, 2026Jan 5, 2026Jan 31, 2026Jan 31, 2026
3Jan 12, 2026Feb 28, 2026Feb 28, 2026
4Jan 19, 2026Mar 31, 2026Mar 31, 2026
5Jan 26, 2026Apr 30, 2026Apr 30, 2026
6Feb 2, 2026
7Feb 9, 2026

How it works

6
Rows to generate.
1
Columns (1 = a vertical list).
A2
The first date.
7
Step in days: 1 = daily, 7 = weekly.
EOMONTH(A2,SEQUENCE(4,1,0))
Month offsets 0,1,2,3 turn into the last day of each month.

Common errors and fixes

Numbers like 46027 instead of dates?

The spill area is formatted as General. Format it as a date.

Why does the formula return #SPILL!?

Clear the cells under the formula.

Does this work in Google Sheets?

Yes. Use the formulas tagged "Google Sheets" on this page; formulas tagged only "Excel" use Excel-specific syntax.