Talk:Documentation/Calc Functions/NETWORKDAYS

SF Comments

 * (1) Summary. It seems odd to say that holidays can be deducted without mentioning that the working week can be re-defined. Suggest the following replacement text – “Calculates the whole number of working days in a period. Holidays can be specified and the working days in each week can be redefined.”.
 * (2) Summary. Suggest including the following as a tip – “To keep dates from being interpreted as parts of formulas use the DATE function, for example, DATE(1954;7;20), or place the date in quotation marks and use the ISO 8601 notation, for example, "1954-07-20". Avoid using locale dependent date formats such as "07/20/54", the calculation may produce errors if the document is loaded under different locale settings.”.
 * (3) Returns. Suggest the following re-word – “Returns an integer value which is the number of working 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 non-work (weekend) days.”
 * (4) Arguments, StartDate. Suggest the following replacement text – “StartDate is a date (in quotation marks) or a date-time sequence 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.”
 * (5) Arguments, EndDate. Suggest the following replacement text – “EndDate is a date (in quotation marks) or a date-time sequence 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.”
 * (6) Arguments, Holidays. Might be worth clarifying this paragraph. If using an inline array, then the values are either dates in quotation marks or date-time sequence numbers. Similarly, if providing a cell range, values can be either dates or date-time sequence numbers.
 * (7) Arguments, Workdays. Need to clarify that this argument can be passed as an inline array of 7 values or as a cell range containing the 7 values.
 * (8) Arguments, new bullet. Suggest adding the following – “If EndDate is earlier than StartDate, the result is a negative integer; if EndDate is later than StartDate, the result is a positive integer.”.
 * (9) Arguments, new bullet. It might be worth noting that NETWORKDAYS ignores any time components of the StartDate, EndDate, and Holidays arguments.
 * (10) Arguments, new bullet. What happens is either StartDate or EndDate is invalid?
 * (11) Arguments, new bullet. Mention that 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 sequence 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.
 * (12) Arguments, new bullet. Mention that if Workdays is passed as an inline array, an Err:502 results if that array is not exactly 7 entries long. Similarly, if a range of cells is passed which comprises less than 7 cells an Err:502 results. If a cell contains an error code (such as #NAME?), that error status will be propagated as the result of NETWORKDAYS. This bullet probably makes the sole existing bullet point redundant.
 * (13) Additional details. Please delete the current contents of this section.
 * (14) Additional details, new paragraph. “The description on this page uses the international standard ISO 8601 date format for clarity because this does not depend on locale; for example, 26th December 2020 is shown as 2020-12-26. The default date format on your computer may be different.”
 * (15) Additional details, new paragraph. “Calc handles date-time values as numbers, known as date-time sequence numbers. For example, 12:00 PM on 2000-01-01, converts to 36526.5 (assuming that day zero is the default 1899-12-30). The value preceding the decimal point corresponds to the date; the value following the decimal point corresponds to the time. Times are represented as a fraction of a day - for example 0.5 is half a day, or 12 hours, or 12 noon; 0.25 is a quarter of a day, or 6 am.”
 * (16) Additional details, new paragraph. “Calc’s NETWORKDAYS function satisfies the requirements of ODF 1.2. If you export a spreadsheet from Calc to 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 argument specified in ODF 1.2. For interoperability with Excel, you can use the NETWORKDAYS_EXCEL2003 or NETWORKDAYS.INTL functions.
 * (17) Examples, general. Given some of the wriggles that I have mentioned in my previous comments, it might be worth including more than two examples.
 * (18) Examples, 2nd example. “calculates” spelt incorrectly. Copied and pasted the formula into Calc and, with my computer setup, it gave a #NAME? error. Investigation needed on someone else’s computer.
 * (19) Related LibreOffice functions. NETWORKDAYS_EXCEL2003 should probably be included in this list.

--Stevefanning (talk) 2020-12-31T00:54:18 (UTC)

My comments listed above addressed on 2021-02-20. --Stevefanning (talk) 2021-02-20T10:25:10 (UTC)