keepcalculator

06 Numbers and Powers

Get Last Weekday in Month? Formula & Calculator

Card No. 06·51381 · Updated · Standard formula, shown below

The calculator on this card is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

This calculator works out the date of the last specified weekday (Monday through Friday) in any given month and year. You enter the year, the month, and which weekday you need, and it returns the exact date, along with the day number and the total number of that weekday in the month. The result is useful for scheduling recurring meetings, payroll runs, bill payments, or content calendars that fall on, say, the last Friday of the month.

Formula

The calculation uses a standard date arithmetic approach. First, determine the last day of the month by taking the first day of the next month and subtracting one day. Then, find the weekday of that last day (using a convention where Monday = 1, Tuesday = 2, …, Sunday = 7). The last occurrence of a target weekday w is found by moving backward from the last day by the difference between the last day’s weekday and w, wrapping around the 7-day cycle.

In words: Last date = Last day of month − ((Weekday of last day − target weekday + 7) mod 7)

Where:

  • Last day of month = day 1 of the next month minus 1 day (e.g., for August, it’s September 1 minus 1 = August 31).
  • Weekday of last day = an integer 1–7, with Monday = 1.
  • Target weekday = the weekday you want to find (1–7).
  • mod 7 ensures the adjustment stays within 0–6 days.

The count of that weekday in the month is either 4 or 5, depending on the month length and the weekday of the first day.

Worked Example

Using the default values: Year = 2025, Month = August, Target weekday = Friday (5).

  1. Last day of August 2025: August has 31 days, so last day = August 31.
  2. What weekday is August 31, 2025? It is a Sunday (weekday 7).
  3. Difference = (7 − 5) = 2. So subtract 2 days from August 31 → August 29.
  4. Check: August 29, 2025 is a Friday. That is the last Friday.
  5. Day number = 29. Count of Fridays in August 2025 = 5 (Aug 1, 8, 15, 22, 29).

The calculator returns: Last date = 2025-08-29, day number = 29, count = 5.

Why the Last Weekday Matters

Many business and administrative cycles are built around the last occurrence of a weekday, not a fixed date. Payroll is often processed on the last Friday, rent may be due on the last business day, and content calendars frequently schedule recurring posts on the last Tuesday or Thursday. Because months vary in length (28–31 days) and weekdays shift each year, the date can move by up to a week. A calculator removes the need to manually count backward each month.

This calculation is also a building block for more complex scheduling rules, such as “the last weekday before the 25th” or “the second-to-last Monday.” By adjusting the target weekday and subtracting an extra 7 days, you can derive those dates as well.

How to Use the Calculator

  • Year: Enter a four-digit year between 1900 and 2100. The Gregorian calendar is assumed.
  • Month: Enter 1–12, where 1 = January and 12 = December.
  • Weekday: Select 1 for Monday, 2 for Tuesday, up to 7 for Sunday. The calculator only works for weekdays (1–5) in the sense of the title, but it will also compute weekends if you choose 6 or 7.

The first output, “Last date,” is the main answer. The “Day number” is the day of the month (e.g., 29). The “Occurrences” tells you whether that weekday appears 4 or 5 times in that month, which is useful for understanding frequency.

Common Mistakes and Misconceptions

A frequent error is confusing “last weekday” with “last business day.” The last business day usually excludes weekends and public holidays, whereas this calculator only considers Monday–Friday. For example, if the last Friday of December falls on a public holiday, the last business day might be Thursday. This calculator does not account for holidays—you must adjust manually or use a holiday calendar.

Another mistake is assuming the last weekday is always the 28th–31st. That’s true, but the exact day depends on the weekday of the month’s last day. For instance, the last Monday of a month that ends on a Tuesday is the 25th, not the 31st.

Also, note that the formula uses a Monday-based weekday numbering. If you are used to Sunday = 1, you must convert. Most spreadsheet functions (like WEEKDAY in Excel) allow you to specify the return type; this calculator uses 1 = Monday.

Alternatives and Related Calculations

If you need the first weekday of the month, the formula is similar: start from the first day of the month and move forward. For the nth weekday (e.g., the third Tuesday), you can compute the first occurrence and add 7×(n−1).

For recurring schedules, you might also want the date of the last weekday in a quarter or year. That requires iterating over months, which is beyond this single-month calculator but can be done by running it for each month.

Spreadsheet users can replicate this in Excel or Google Sheets with formulas like =EOMONTH(date,0)-MOD(WEEKDAY(EOMONTH(date,0),2)-target,7), where target is the weekday number (1=Monday). The advantage of this calculator is that it handles the date math without needing to know the quirks of spreadsheet functions.

Limitations and Accuracy

The calculator is accurate for all dates in the Gregorian calendar, which is the standard civil calendar in most of the world. It does not account for historical calendar changes (e.g., the switch from Julian to Gregorian) or for countries that use different calendar systems. For any year between 1900 and 2100, the result is exact.

The count of occurrences is always 4 or 5 for any weekday in a month. A 31-day month has three weekdays that occur five times; a 30-day month has two; February (28 days) has all weekdays exactly four times, and in a leap year (29 days) one weekday occurs five times.

Frequently Asked Questions

What is the last weekday of a month?

The last weekday is the final Monday, Tuesday, Wednesday, Thursday, or Friday of that month. For example, in August 2025, the last Friday is August 29, and the last Monday is August 25.

How do I calculate the last Friday of a month manually?

Find the last day of the month, determine its weekday, then subtract the number of days needed to go back to Friday. For instance, if the last day is a Wednesday, subtract 5 days to get the previous Friday (since Wednesday – Friday = 5 days). If the last day is already Friday, that’s your answer.

Does the calculator work for weekends?

Yes, you can select Saturday (6) or Sunday (7), and it will return the last Saturday or Sunday. The title focuses on weekdays, but the formula is generic.

Why does the last weekday sometimes fall on the 25th and sometimes on the 31st?

Because the weekday of the last day of the month varies. If a month ends on a Sunday, the last Monday was the 25th. If it ends on a Friday, the last Friday is the 31st. The date shifts by up to 6 days.

What if I need the last business day, excluding holidays?

This calculator does not consider holidays. After finding the last weekday, check a holiday calendar for your region. If that day is a holiday, move back one day at a time until you find a non-holiday weekday.

Can I use this for scheduling recurring meetings?

Yes. Many meeting schedulers support “last weekday” rules, but if yours doesn’t, you can use this calculator to find the dates for each month and add them manually. For example, a team meeting on the last Wednesday of the month can be planned for all months in 2025.

Related

Formula used
in t | Year | - | 2025 | 1900 | 2100
in m | Month | - | 8 | 1 | 12
in w | Weekday (1=Mon … 7=Sun) | - | 5 | 1 | 7
out last | Last date of that weekday | - | last | 0
out daynum | Day number | - | daynum | 0
out count | Occurrences in month | - | count | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →