
Reviews
Should the holiday calendar live in a spreadsheet or a service?
Where a working-day calendar should live, the date contract between sheet and service, and a sixteen-case parity suite pinned to NETWORKDAYS and the Nager.Date API.
A spreadsheet and a service can both count working days correctly. They still disagree in practice, and the cause is almost never the arithmetic. It is a convention one side applied and the other did not: whether both ends count, which dates are closed, and whether a holiday is stored on its own date or on the day it is observed. This page says where the calendar should live, what a date must look like when it moves between the two, and gives a sixteen-case suite that proves they agree.
What to take away
- Editorial suggestionkeep one dated closure list with an id and a version. Load that same version into the sheet and into the service, and echo it in every answer.
- Send dates between the two as
YYYY-MM-DDtext. Convert to a serial only inside the sheet. - Excel's
NETWORKDAYScounts both ends. Google documents the same arguments but not the endpoint rule, so pin it in a test. - The Nager.Date API returned United States holidays in two different ways when checked on 26 October 2026. Its v3 endpoint put Juneteenth 2027 on Friday 18 June (the observed date), and its v4 endpoint put it on Saturday 19 June (the actual date). The two give different working-day counts.
- Editorial suggestionmove from a sheet to a service when several people compute the same kind of date, or when the answer must land in another system's record.
What each tool class is for
| Question | Spreadsheet | Service |
|---|---|---|
| One person needs one date, now | Yes | Overkill |
| Several people need the same kind of date | Each copy drifts | One calendar, one convention |
| The date belongs to a record in another system | No | Yes |
| The answer must be reproduced months later | Only if the closure tab is versioned | Yes, if the calendar is versioned |
| Someone must audit the working | Yes, the formula is visible | Only if the response echoes its inputs |
This table is the desk's own judgement and not a vendor claim. Editorial suggestion: if a single workbook is the only consumer, stay in the sheet.
The sheet side is documented well. Microsoft's NETWORKDAYS and NETWORKDAYS.INTL both take a start, an end and an optional holiday range; the second adds a weekend argument. Google Sheets has a NETWORKDAYS with the same shape and says only Saturday and Sunday count as the weekend; for other weekends it points to NETWORKDAYS.INTL. Neither sheet knows anything about your closures until you supply them.
The date contract
A sheet stores a date as a number. Microsoft documents that by default 1 January 1900 is serial number 1. Google's Sheets API says serial numbers count days from 30 December 1899, with the time of day as the fraction. The serial and epoch detail, including the 1904 system, is in Excel date serials and the 1900 and 1904 epochs.
A service sends text. RFC 3339 defines full-date as year, month and day with hyphens, and a date-time that always carries a Z or a numeric offset. Editorial suggestion, a rule that survives every boundary:
- Send a plain date as
2027-03-05. Never send a moment where a date is expected, and never a bare serial. - Send a moment only when hours matter, with an offset.
- Convert to a serial inside the sheet with
DATE, and keep closure dates as real date values. Microsoft says text dates can cause problems and that an invalid date makesNETWORKDAYSreturn#VALUE!.
The failure modes of each crossing are collected in spreadsheet and API tools: common mistakes. The formula behind a date difference is in the days-between-dates formula.
A request that carries everything
Editorial suggestion: a service whose request states every assumption, and whose response echoes them, can be swapped or audited without changing the answer. This shape is the desk's own, not a standard.
request
operation: between | add | subtract
start: 2027-03-01
end: 2027-03-08
weekend: "0000011" (Monday to Sunday, 1 = rest day)
calendar: { id: "us-federal-observed", version: "opm-2026-10-25" }
start_counts: true
end_counts: true
response
result: 6
skipped: [ dates passed over ]
applied: { weekend, calendar, start_counts, end_counts }
The weekend string follows the seven-character form Microsoft documents for NETWORKDAYS.INTL: Monday first, 1 for a non-working day, 0000011 for Saturday and Sunday. Carrying the calendar id and version in the request is what lets someone answer, six months later, which list produced a date.
What the Nager.Date API actually returns
Nager.Date is an open-source public holiday API. Its documentation describes a path of the form /api/v4/Holidays/{CountryCode}/{Year}, says there are no rate limits, and names no data source or accuracy guarantee. Editorial suggestion: treat it as a convenience feed, not an authority. For United States federal dates the authority is the Office of Personnel Management.
The documentation page describes only the v4 path. The older v3 path, https://date.nager.at/api/v3/PublicHolidays/2027/US, was still answering when checked on 26 October 2026, and the v4 path was https://nagerholidays.com/api/v4/Holidays/US/2027. The two returned the following for the United States and 2027, and three points matter for parity:
- Observed versus actual dates.The v3 path returned 18 June, 5 July and 24 December, the dates OPM lists as observed. The v4 path returned 19 June, 4 July and 25 December, the dates on which the holidays fall. All three are weekend dates, so a sheet that loads v4 as-is stops removing a weekday on 18 June, 5 July and 24 December.
- Filtering.Each response carries 17 rows, including state-level observances. Filtering to national holidays (
globaltrue in v3,nationalHolidaytrue in v4) of type Public or Bank gave eleven dates. Filtering those on type Public alone gave ten, because Columbus Day is listed as Public only for some states and as a national Bank holiday. - Year edges.The v3 response for 2028 included 31 December 2027, the observed New Year's Day, which OPM also lists in its 2028 table. The v4 response for 2028 listed 1 January 2028, a Saturday. A harness that requests only the year of the span misses 31 December 2027 in both cases.
After filtering v3 to its national rows, the eleven dates match OPM's 2027 table. That is the check to run whenever the feed changes: compare the set of dates with the publisher's, not just the count.
The pinned conventions
Before any case can have an expected value, fix four things and write them at the top of the suite:
- Both ends of a range count.
- Saturday and Sunday are the rest days.
- Closures are an explicit list of dates with an id and a version. Here the list is the eleven observed dates in OPM's 2027 schedule: 1 January, 18 January, 15 February, 31 May, 18 June, 5 July, 6 September, 11 October, 11 November, 25 November and 24 December.
- Every date travels as ISO text.
Sixteen parity cases
Run each through the sheet formula =NETWORKDAYS(start, end, Closures) and through the service, using the same list. Expected values were worked out by counting days one by one, not taken from either implementation. Dates are in 2027 unless stated.
| # | Case | Start | End | Closures | Expect |
|---|---|---|---|---|---|
| 1 | Ordinary week | Mon 1 Mar | Mon 8 Mar | none | 6 |
| 2 | Across a weekend | Fri 5 Mar | Mon 8 Mar | none | 2 |
| 3 | Weekend only | Sat 6 Mar | Sun 7 Mar | none | 0 |
| 4 | One open day | Fri 5 Mar | Fri 5 Mar | none | 1 |
| 5 | One rest day | Sat 6 Mar | Sat 6 Mar | none | 0 |
| 6 | Whole month | Mon 1 Mar | Wed 31 Mar | none | 23 |
| 7 | Reversed | Mon 8 Mar | Mon 1 Mar | none | -6 or an error |
| 8 | Whole year | 1 Jan | 31 Dec | none | 261 |
| 9 | Whole year, closed | 1 Jan | 31 Dec | the eleven | 250 |
| 10 | Observed date | Thu 17 Jun | Mon 21 Jun | the eleven | 2 |
| 11 | Actual date | Thu 17 Jun | Mon 21 Jun | 19 Jun in place of 18 Jun | 3 |
| 12 | Sunday holiday | Fri 2 Jul | Tue 6 Jul | the eleven | 2 |
| 13 | Saturday holiday | Thu 23 Dec | Mon 27 Dec | the eleven | 2 |
| 14 | Duplicate row | Fri 8 Oct | Tue 12 Oct | the eleven plus 11 Oct again | 2 |
| 15 | Year edge | Thu 30 Dec | Mon 3 Jan 2028 | the eleven | 3 |
| 16 | Year edge, added | Thu 30 Dec | Mon 3 Jan 2028 | the eleven plus 31 Dec | 2 |
Case 7 has two defensible answers, so pin one. Microsoft's NETWORKDAYS.INTL page says a start date later than the end date gives a negative result whose magnitude is the number of whole workdays; its NETWORKDAYS page is silent on the case. A service that returns 6 has swapped the arguments without saying so. Cases 4 and 5 are the ones that catch an endpoint mismatch, because the conventions differ by the whole answer there rather than by one. Case 14 expects a repeated closure date to be applied once; Microsoft's page does not say so, so run it in your own tool and treat any other result as a finding. Case 11 reproduces the Nager.Date v3 and v4 split, and a service loading v4 unadjusted fails it. Cases 15 and 16 show why the list has to cover the year after the span as well.
Suppose the sheet column returns 6 for case 1 and the service returns 5. The service has left out the end date while NETWORKDAYS includes it. Pin convention 1, re-run, and the suite is green. A disagreement on one row at the edge is the whole purpose of the suite. Re-run it when either side changes, when the closure list changes, and when someone adds a calendar.
When to move from sheet to service
Editorial suggestion, not a vendor rule. Move when more than one person computes the same kind of date, when the date must be written into another system's record, when someone can challenge a result and expect the working back, or when the calendar changes more often than every workbook gets updated. Until then the sheet is the better tool: its formula is visible and the sixteen cases above take minutes to run.
A service does not remove the judgment in the closure list. It moves it to one place. Editorial suggestion: whoever owns the list should record the publisher, the retrieval date and the version, and the layers a deadline may depend on are covered in how country calendars are made. Forward and backward counts have their own edge cases, which are in adding business days.
Sources
- [Microsoft
- NETWORKDAYS function](https://support.microsoft.com/en-us/office/networkdays-function-48e717bf-a7a3-495f-969e-5005e3eb18e7)
- [Microsoft
- NETWORKDAYS.INTL function](https://support.microsoft.com/en-us/office/networkdays-intl-function-a9b26239-4f20-46a1-9ab8-4e925bfd5e28)
- [Microsoft
- DATE function](https://support.microsoft.com/en-us/office/date-function-e36c0c8c-4104-49da-ab83-82328b832349)
- Google Docs Editors Help
- NETWORKDAYS
- [Google Sheets API
- DateTimeRenderOption](https://developers.google.com/sheets/api/reference/rest/v4/DateTimeRenderOption)
- [Nager.Date
- Public holiday API documentation](https://nagerholidays.com/Api)
- [Nager.Date v3 response
- US public holidays 2027](https://date.nager.at/api/v3/PublicHolidays/2027/US)
- [Nager.Date v4 response
- US holidays 2027](https://nagerholidays.com/api/v4/Holidays/US/2027)
- [U.S. Office of Personnel Management
- Federal holidays](https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/)
- [IETF RFC 3339
- Date and time on the Internet](https://www.rfc-editor.org/rfc/rfc3339)
In this guide
- How dates survive or break moving between Excel, Google Sheets and APIsDate serials, the 1900 and 1904 epochs 1,462 days apart, text dates, Google Sheets locale and time zone, and API formats, with worked values you can check in a sheet.
- Spreadsheet Date and Workday Counting MistakesSpreadsheet date and workday-count mistakes: text dates, locale-dependent imports, midnight shifts, serial values, endpoint rules, and closure ranges.







