NETWORKDAYS function
Note: This draft page is under construction 🚧
Overview
NETWORKDAYS is a function of the Date and Time category that calculates the number of working days between two dates, excluding weekends (Saturday and Sunday by default) and optionally specified holidays.
Usage
Syntax
NETWORKDAYS(start_date, end_date, [holidays]) => workdays
Argument descriptions
- start_date (number, required). The start date expressed as a serial number.
- end_date (number, required). The end date expressed as a serial number.
- holidays (array or range, optional). A list of dates to exclude from the calculation, expressed as serial numbers.
Additional guidance
- If the supplied start_date and end_date arguments have fractional parts, NETWORKDAYS uses their floor values.
- If start_date is later than end_date, the function returns a negative number.
- Weekend days are Saturday and Sunday by default. Use NETWORKDAYS.INTL for custom weekend definitions.
- Empty cells in the holidays array are ignored.
- The calculation includes both the start and end dates if they are workdays.
Returned value
NETWORKDAYS returns a number representing the count of working days between the two dates.
Error conditions
In common with many other IronCalc functions, NETWORKDAYS propagates errors that are found in its arguments.
If fewer than 2 or more than 3 arguments are supplied, then NETWORKDAYS returns the
#ERROR!error.If the start_date or end_date arguments are not (or cannot be converted to) numbers, then NETWORKDAYS returns the
#VALUE!error.If the start_date or end_date values are outside the valid date range, then NETWORKDAYS returns the
#NUM!error.If the holidays array contains non-numeric values, then NETWORKDAYS returns the
#VALUE!error.For more information about the different types of errors that you may encounter when using IronCalc functions, visit our Error Types page.
Details
IronCalc utilizes Rust's chrono crate to implement the NETWORKDAYS function. The function treats Saturday and Sunday as weekend days.
Examples
See some examples in IronCalc.
Links
- See also IronCalc's NETWORKDAYS.INTL function for custom weekend definitions.
- Visit Microsoft Excel's NETWORKDAYS function page.
- Both Google Sheets and LibreOffice Calc provide versions of the NETWORKDAYS function.