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.

Microsoft 365, Excel 2024, and Excel for the web. Excel 2021 does not have LAMBDA.

Syntax =xl.nth.weekday(year, month, nth, weekday)

xl.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

NameRequiredWhat to pass
yearRequiredThe four-digit year.
monthRequiredThe month number, 1 through 12.
nthRequiredWhich occurrence. 4 is the fourth. There is no fifth in some months.
weekdayRequiredThe 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

=DATE(B1,B2,1)+MOD(B4-WEEKDAY(DATE(B1,B2,1),1)+7,7)+(B3-1)*7B5
Thanksgiving
AB
1Year2026
2Month11
3Nth4
4Weekday5
5Date11/26/2026
A picture of the sheet, not a live calculator. Format B5 as a date.

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.