Calculator: Weekday occurrences in a date range

Enter the labelled inputs to calculate: Count.

Count
4

How the calculation works

Dfirst=D₀+[(w−weekday(D₀)+7) mod 7]; count=max(0,1+floor[(D₁−Dfirst)/7])

Dates are civil calendar dates without timezone or daylight-saving changes. The weekday count includes both endpoints. Study days include every calendar day, starting on the supplied date.

Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.

Frequently asked questions

How is the result calculated?

Dfirst=D₀+[(w−weekday(D₀)+7) mod 7]; count=max(0,1+floor[(D₁−Dfirst)/7])

What assumptions apply?

Dates are civil calendar dates without timezone or daylight-saving changes. The weekday count includes both endpoints. Study days include every calendar day, starting on the supplied date.

How precise are the displayed results?

Numerical results show up to ten significant digits. Rounding does not improve the accuracy of the input measurements or the model. Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.

How we verified this calculator

The calculator is checked against 3 reference cases computed independently from the sources below. Last passed: .

# Inputs Expected result
1
Start date = 2026-01-01
Reference date = 2026-12-31
ISO weekday (1=Monday, 7=Sunday) = 1
Count: 52
2
Start date = 2026-11-01
Reference date = 2026-11-30
ISO weekday (1=Monday, 7=Sunday) = 7
Count: 5
3
Start date = 2024-02-01
Reference date = 2024-02-29
ISO weekday (1=Monday, 7=Sunday) = 4
Count: 5

Sources

How we test our calculators →

Also try:

Back to category →