LAMBDA · Date and time
Month sequence LAMBDA
xl.sequence.months spills the first day of each month. Three months from July 4, 2026 are July 1, August 1, and September 1.
Syntax =xl.sequence.months(day, n)
=LAMBDA(day, n,
LET(
first, DATE(YEAR(day), MONTH(day), 1),
EDATE(first, SEQUENCE(n) - 1)
)
)Arguments
| Name | Required | What to pass |
|---|---|---|
| day | Required | Any date in the first month. The day of the month is ignored. |
| n | Required | How many month-starts to spill. |
Examples
The quarter that contains July 4, 2026
=xl.sequence.months(DATE(2026,7,4), 3)Result July 1, August 1, and September 1, 2026
| A | |
|---|---|
| 1 | 7/1/2026 |
| 2 | 8/1/2026 |
| 3 | 9/1/2026 |
xl.sequence.months builds a column of month starts. From any day in July 2026, three months are July 1, August 1, and September 1. The input day does not have to be the first. July 4 and July 31 both start the sequence on July 1.
Use it as the header row of a forecast or as the dates for EDATE-style rent. MAKEARRAY builds a grid from row and column numbers, such as two rents stepping by $50. This LAMBDA stays one column of month starts.
Add it to the workbook
Copy the formula in the block above, including the line breaks. Choose Formulas, Name Manager, New. Set the name to xl.sequence.months, the scope to Workbook, and paste into Refers to. Excel Labs can do the same step: open the Advanced Formula Environment, add that name, and save it back to the workbook. A cell then calls =xl.sequence.months(...).
The name needs Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME? for LAMBDA even when it already has XLOOKUP, FILTER, or LET.
How it works
DATE rebuilds the first of the input month. SEQUENCE(n) - 1 is 0, 1, 2, and so on. EDATE of the first of the month plus those offsets is the following firsts. EDATE from the first never trips over a short February, because the day is 1.
Limits
The result is a date serial. Format the spill as a date. A negative count is a #CALC! or a #VALUE! from SEQUENCE, not a backward list. Walk backward with a negative step only if you build that variant yourself.