LAMBDA · Date and time
Nth weekday LAMBDA
xl.nth.weekday returns the nth weekday of a month. The fourth Thursday of November 2026 is November 26, Thanksgiving.
Syntax =xl.nth.weekday(year, month, nth, weekday)
=LAMBDA(year, month, nth, weekday,
LET(
first, DATE(year, month, 1),
offset, MOD(weekday - WEEKDAY(first, 1) + 7, 7),
first + offset + (nth - 1) * 7
)
)Arguments
| Name | Required | What to pass |
|---|---|---|
| year | Required | The four-digit year. |
| month | Required | The month number, 1 through 12. |
| nth | Required | Which occurrence. 4 is the fourth. There is no fifth in some months. |
| weekday | Required | The Excel default weekday number. Sunday is 1 and Saturday is 7. Thursday is 5. Monday is 2. |
Examples
Thanksgiving 2026
=xl.nth.weekday(2026, 11, 4, 5)Result Thursday, November 26, 2026
| A | B | |
|---|---|---|
| 1 | Year | 2026 |
| 2 | Month | 11 |
| 3 | Nth | 4 |
| 4 | Weekday | 5 |
| 5 | Date | 11/26/2026 |
xl.nth.weekday builds dates such as the third Monday or the fourth Thursday. Thanksgiving 2026 is the fourth Thursday of November, which is November 26. The weekday numbers are Excel’s default: Sunday 1, Monday 2, Thursday 5, Saturday 7.
Memorial Day is the last Monday, not a fixed nth. Use xl.us.holiday for that one, or walk back from the last day of May.
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.nth.weekday, 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.nth.weekday(...).
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 builds the first of the month. WEEKDAY of that day, with return type 1, is Sunday-based. The MOD expression is how many days forward the first of the month must move to land on the requested weekday. Adding (nth - 1) * 7 steps to the later occurrence. November 1, 2026 is a Sunday, weekday 1. Thursday is 5, so the offset is 4 and the first Thursday is November 5. Three more weeks land on November 26.
Limits
The result is not clamped to the month. A 5th Thursday that does not exist comes back as a date in the next month. The function does not observe a Saturday holiday on Friday. It returns the weekday you asked for.