Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Total days in period (inclusive)
1
days
Weekday Count
Mondays 0
Tuesdays 0
Wednesdays 1
Thursdays 0
Fridays 0
Saturdays 0
Sundays 0

What this calculator does

The Weekday Count in Date Range Calculator tells you how many Mondays, Tuesdays, Wednesdays, Thursdays, Fridays, Saturdays and Sundays fall between two dates, counting both endpoints (inclusive). It also reports the total number of days in the period. This is handy for shift planning, payroll, counting working days, or simply answering "how many Fridays are there this year?"

A calendar date range with each weekday tallied into seven labeled buckets
Each day in the selected range is sorted into one of seven weekday buckets, Monday through Sunday.

How to use it

Pick a start date and an end date using the year, month and day fields. Leave the calendar set to "Western (CE/Gregorian)" for ordinary dates. An optional Japanese-era mode (Meiji, Taisho, Showa, Heisei, Reiwa) is offered as a convenience: when chosen, the year you enter is treated as the era-year and converted to its Gregorian equivalent before any math is done. The underlying date arithmetic is universal and not specific to any country.

The formula

Each date is converted to a day serial number. The inclusive day count is \(\text{totalDays} = \text{endSerial} - \text{startSerial} + 1\). Since a week has seven days, every weekday occurs at least \(\text{baseline} = \text{totalDays} \mathbin{\text{div}} 7\) times. The leftover \(\text{remainder} = \text{totalDays} \bmod 7\) days are the extra occurrences; they are assigned consecutively starting from the start date's weekday. The weekday of any Gregorian date is found with Sakamoto's algorithm.

$$\begin{gathered} \text{Count}(w) = \left\lfloor \frac{N}{7} \right\rfloor + \bigl[\,(w - w_0) \bmod 7 < (N \bmod 7)\,\bigr] \\[1.5em] \text{where}\quad \left\{ \begin{aligned} N &= (\text{Serial}_{\text{end}} - \text{Serial}_{\text{start}}) + 1 \\ \text{start} &= \text{Start Yr}/\text{Mo}/\text{Day} \\ \text{end} &= \text{End Yr}/\text{Mo}/\text{Day} \\ w_0 &= \text{weekday of start date} \end{aligned} \right. \end{gathered}$$
Diagram showing total days split into full weeks plus a remainder
Total days divide into whole weeks (each weekday gets one) plus a remainder that adds one to the first few weekdays.

Worked example

From 2024-01-01 (a Monday) to 2024-12-31 (a Tuesday): 2024 is a leap year, so \(\text{totalDays} = 366\).

$$\text{baseline} = 366 \div 7 = 52, \quad \text{remainder} = 366 \bmod 7 = 2$$

Starting at Monday, the first two weekdays (Monday and Tuesday) each get \(+1\). Result: 53 Mondays, 53 Tuesdays, and 52 of every other weekday — which sum to 366.

FAQ

Is the count inclusive? Yes — both the start and end dates are included. A single day (start = end) gives a total of 1.

What if the start date is after the end date? The dates are swapped automatically so the total is always positive.

Which calendar is used? The proleptic Gregorian calendar throughout. For modern dates this matches the everyday civil calendar exactly; very old dates before 1582 may differ from historical Julian records.

Last updated: