Documentation/Calc Functions/NETWORKDAYS

Function name:
NETWORKDAYS

Category:
Date and Time

Summary:
Calculates the net number of work or business days between two dates. Holidays (or other non-work days) can be specified and the standard workweek can be redefined.

Syntax:
NETWORKDAYS(StartDate; EndDate[; [Holidays][; Workdays]])

Returns:
Returns an integer value which is the number of work or business days in the given period, excluding defined holidays and weekend days. The start and end dates of the period are counted unless they are defined as holidays or weekend days.

Arguments:
StartDate is the date (in quotation marks) or a date-time serial number, or a reference to the cell containing one of those types, which is either the start date or the end date of the period for which the calculation is to be carried out.

EndDate is the date (in quotation marks) or a date-time serial number, or a reference to the cell containing one of those types, which is either the end date or the start date of the period for which the calculation is to be carried out.

Holidays is a list of dates corresponding to holidays (or any other days) that are to be excluded from the count as non-work days. This list can be passed as a range of cells containing date-time serial numbers (possibly displayed in a date format). Alternatively, the list can be passed as an inline array containing either date strings (in quotation marks) or date-time serial numbers. If omitted, no holidays are assumed.

Workdays is a list of numbers defining the standard workweek. This list contains seven entries with the first entry corresponding to Sunday and the seventh entry corresponding to Saturday. Each number is either zero to indicate a workday or non-zero (usually 1) to indicate a non-work day. This list can be passed either as a range of cells containing the numbers or as an inline array. If omitted, the default configuration is for only Saturday and Sunday to be non-work days ({1; 0; 0; 0; 0; 0; 1} when expressed as an inline array).


 * If either StartDate or EndDate is not a valid date expression, then NETWORKDAYS reports a #VALUE! error.
 * If StartDate is earlier than EndDate, the result is a positive integer; if StartDate is later than EndDate, the result is a negative integer.
 * NETWORKDAYS ignores any time components of StartDate and EndDate.
 * If Holidays is passed as an inline array, a #VALUE! error results if any entry of that array is not a date or a date-time sequence number.
 * If Holidays is passed as a cell range, then in most cases cells that do not contain a date or a date-time serial number lying within the relevant period are ignored. However, if a cell contains an error code (such as #NAME?), that error status will be propagated as the result of NETWORKDAYS.
 * If Workdays does not specify exactly seven numbers, NETWORKDAYS reports an invalid argument error (Err:502).
 * If Workdays is passed as a cell range, if a cell contains an error code (such as #NAME?), that error status will be propagated as the result of NETWORKDAYS.

Details specific to NETWORKDAYS function
NETWORKDAYS is inclusive, counting the first and last days of the period (see section below).

Calc’s NETWORKDAYS function satisfies the requirements of ODF 1.2. If you export a spreadsheet from Calc to Microsoft Excel that contains calls to NETWORKDAYS which utilize all four arguments, then that spreadsheet will generate errors when opened in Excel. This is because the Excel NETWORKDAYS function does not support the Workdays parameter specified in ODF 1.2. For interoperability with Excel, you can use the NETWORKDAYS.INTL function.

Related LibreOffice functions:
NETWORKDAYS.INTL

NETWORKDAYS_EXCEL2003

ODF standard:
Section 6.10.14, part 2

Equivalent Excel functions:
None.