CALENDAR AND GEOMETRY BOUNDARY CHECKS

Checking the endpoints in a weekday-count interval

The weekday-count tool counts Monday through Friday dates from the start date up to, but not including, the end date. That boundary rule decides the answer for a one-day interval.

A half-open interval

In interval notation, the counted range is [start, end): it contains the start and stops before the end. The tool tests each date d with start <= d < end, keeps the Monday to Friday dates, and removes any dates in the supplied exclusion list. Half-open ranges are common in programming and in time measurement because adjacent intervals join without overlap. A range from Monday to Tuesday and a range from Tuesday to Wednesday together cover Monday and Tuesday exactly once each, with no double counting of Tuesday. The price of that convenience is that people who think of a date range as inclusive at both ends will get answers that are one lower than expected.

Monday to Tuesday returns one

The first worked case runs from Monday 2026-10-19 to Tuesday 2026-10-20 with no exclusions. The only date in the interval is Monday, which is a weekday, so the count is 1. The Tuesday end date is excluded even though it is also a weekday. A reader who thinks of the dates as two days, Monday and Tuesday, and counts both, would expect 2. The tool follows the half-open rule, so it reports 1. Spreadsheet functions and database queries vary on this point, which is why a result carried from another system should be rechecked against a known pair like this one before it is trusted. The same dates also give the number of date steps between them, which is also 1, so the weekday count and the elapsed days agree when there are no weekends or exclusions in the interval.

Equal dates return zero

The second case uses Monday 2026-10-19 as both start and end. With start <= d < end and start equal to end, no date satisfies both inequalities, so the interval is empty and the count is 0. This holds for any date, weekday or weekend. An empty result is correct under the rule, and it is also how a program can use the tool for a zero-length period without special handling. If you actually wanted to know whether the single date is a qualifying weekday, enter the next day as the end. Monday to Tuesday returns 1, and Saturday to Sunday returns 0.

Matching an inclusive list

Suppose a task description says working days from Monday 2026-10-19 through Friday 2026-10-23, inclusive of both. The dates are Monday to Friday, five of them. To get 5 from the half-open tool, set the end to the day after the last included date, Saturday 2026-10-24. Entering Friday as the end returns 4, because the Friday is excluded. The conversion is always to add one calendar day to an inclusive end date. If the inclusive end is Friday, the added day is a Saturday, which does not need to qualify, since the end date is never counted. The reverse conversion works too: a half-open count from 2026-10-19 to 2026-10-24 covers the dates through Friday 2026-10-23. When you read a request such as from the 19th to the 23rd inclusive, write the conversion down once, so every later count in the same project uses it the same way.

Adjacent intervals and weekends

Consider counting Friday 2026-10-23 to Monday 2026-10-26. The dates are Friday, Saturday and Sunday, so the count is 1. The next interval, Monday 2026-10-26 to Tuesday 2026-10-27, adds the Monday and returns 1. The whole span from Friday 10-23 to Tuesday 10-27 gives 2, equal to the sum of the parts. That additivity is the practical benefit of excluding the end date. Splitting a long span at any date and counting the pieces separately produces the same total as counting once, which is a good way to check a large count: split it and compare.

Effect of an excluded date

The exclusion list removes qualifying dates from the count. From Monday 2026-10-19 to Saturday 2026-10-24, the five weekdays give a count of 5. If Wednesday 2026-10-21 is excluded, the count falls to 4. An excluded date on the weekend has no effect, because weekends were already not counted, so counting from 2026-10-19 to 2026-10-26 with Saturday 2026-10-24 excluded still returns 5. An excluded date equal to the end date also changes nothing, since the end is outside the interval. These behaviors follow directly from the rule in the first section, and each is easy to test with the dates above. Two exclusions on the same weekday reduce the count by one only, since a date is either in the set or outside it.

Estimating longer spans from whole weeks

For long intervals, whole weeks give a quick check on the tool. Every run of seven consecutive dates contains five weekdays, whatever day it starts on. From Monday 2026-10-19 to Monday 2026-11-16 is 28 days, or four weeks, so the count is 4 × 5 = 20. Extend the end to Wednesday 2026-11-18 and the interval gains a Monday and a Tuesday, giving 22. If the leftover days include a weekend, add only the weekdays among them. The estimate takes seconds and will flag an exclusion list entered in the wrong field or a typo in the year. Subtract one for each qualifying date in the exclusion list that falls inside the span, since the tool removes those too.

Writing the convention beside the result

A count of 4 is ambiguous without its convention. Someone reading a record months later may not know whether the start was included, whether the end was excluded or which days counted as working days. Record the start date, the end date, the half-open rule and the exclusion list with each saved result. If you pass results between tools or teams, check that each uses the same rule, because a spreadsheet function or a legal calendar may count the end date. A simple note such as start included, end excluded, Monday to Friday, no exclusions removes the ambiguity.

What this count does not cover

The tool uses a fixed Monday to Friday week and a list that you supply, so it does not know about regional holidays, half days, or organizations that work on Saturdays. It does not apply a jurisdiction's deadline rule, which might exclude the start day, include the end day or roll a deadline forward to the next business day. For legal, financial or contractual periods, follow the governing rule and verify the result against an authoritative source. As an arithmetic check of boundaries it is reliable, and the convention is stable.

Reproduce the checks

One weekday interval

Open the Business Days Calculator and enter:

Start
2026-10-19
End
2026-10-20
Holiday dates (optional)

Expected output:

Business days

1

The Monday belongs to the interval and Tuesday does not.

Empty interval

Open the Business Days Calculator and enter:

Start
2026-10-19
End
2026-10-19
Holiday dates (optional)

Expected output:

Business days

0

Equal boundaries contain no dates under this convention.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks