Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Day of the Month
1
This is the date you are looking for
First matching weekday 1
Days in month 31
Occurrence exists Yes

What this calculator does

The Nth Weekday of the Month Calculator finds the exact calendar date of a recurring weekday rule such as "the 3rd Monday of January" or "the 1st Friday of December." These rules are everywhere: US federal holidays (Thanksgiving is the 4th Thursday of November), monthly meetings, payroll dates, options-expiration Fridays, and scheduled bills. Instead of counting boxes on a calendar, you simply choose the year, month, occurrence, and weekday, and the tool returns the day of the month.

Calendar month grid with the third Monday highlighted
The calculator pinpoints a date like the 3rd Monday within a month grid.

How to use it

Pick the year and month, choose which occurrence you want (1st through 5th), and select the weekday. The calculator returns the matching day of the month. It also tells you whether that occurrence actually exists — a 5th weekday only happens in some months — and shows the day of the first matching weekday so you can see the whole series (add 7 for each later occurrence).

The formula explained

First we determine the weekday of the 1st of the month, called f (1 = Sunday through 7 = Saturday). To reach the first occurrence of the target weekday w, we add an offset of \((w - f + 7) \bmod 7\) days. Each additional occurrence is exactly 7 days later, so the nth occurrence lands on:

$$\text{day} = 1 + \big((w - f + 7)\bmod 7\big) + (n - 1) \times 7$$

If this value exceeds the number of days in the month, that occurrence does not exist (for example, there is no 5th Tuesday in a month where Tuesdays fall on the 1st, 8th, 15th, 22nd, and 29th only when the month has at least 29 days).

Diagram showing how to count seven-day jumps from the first occurrence of a weekday
Find the first matching weekday, then step forward in 7-day jumps for the 2nd, 3rd, 4th and 5th.

Worked example

Find the 3rd Monday of January 2024. January 1, 2024 is a Monday, so \(f = 2\) and \(w = 2\). The offset is \((2 - 2 + 7) \bmod 7 = 0\), so the first Monday is the 1st. The 3rd Monday is $$1 + 0 + (3 - 1) \times 7 = \mathbf{15}.$$ So the date is January 15, 2024 — which was indeed Martin Luther King Jr. Day.

FAQ

What weekday numbering is used? Sunday = 1 through Saturday = 7, the same as the input dropdown.

Why does it say the occurrence does not exist? Some months only have four of a given weekday. If you ask for the 5th and there are only four, the calculated day exceeds the month length and is flagged as not existing.

Can I find the last weekday of a month? Choose the 5th occurrence first; if it exists it is the last one, otherwise the 4th occurrence is the last.

Last updated: