Find the last chosen weekday of a month

Turn November 4, 2026 and weekday 5 into the last Friday of that month: November 27, 2026.

What you'll make

In Excel: November 4, 2026 + weekday 5 becomes Friday November 27, 2026.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesFor row 8
1EOMONTH(A8,0)The last day of the date's month.November 30, 2026
2WEEKDAY( … ,2)The weekday of that last day. Monday is 1.1
3-B8Takes away the weekday you want, 1 to 7.1 - 5 = -4
4-MOD( … ,7)Steps back 0 to 6 days to reach your weekday.November 27, 2026

Parts 2 and 3 work inside MOD. MOD turns their difference into 0 to 6 days to step back.

=EOMONTH(A8,0)-MOD(WEEKDAY(EOMONTH(A8,0),2)-B8,7)

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own dates. Paste real dates and weekday numbers (1 to 7) into the green columns of the Template tab. The dates fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Holidays still count. Check any date that lands on a holiday.

Microsoft's help: WEEKDAY function