Excel: Using NETWORKDAYS() With Multiple Holidays

Last reviewed: November 30, 1994
Article ID: Q89507
The information in this article applies to:
  • Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0
  • Microsoft Excel for the Macintosh, versions 4.0, 5.0

SUMMARY

When using the NETWORKDAYS() function with multiple holidays, the holidays may be entered as cell references or in the serial number format and the dates must be enclosed in braces ({}).

In the NETWORKDAYS() function, dates in the form of text are ignored if your worksheet is in the 1904 date system (Options Calculation). This problem is more likely to occur on the Macintosh platform where the 1904 date system is the default. Dates represented as serial numbers will be accepted.

MORE INFORMATION

The NETWORKDAYS() function returns the number of whole working days between two dates. The Holidays parameter is used to exclude specific dates from the calculation. Starting and Ending dates can be entered directly as serial numbers, as text, through a cell reference, or by using the DATEVALUE() function. Single holidays can also be entered this way. However, multiple holidays must be entered in the serial number format only, and the set of holiday dates must be enclosed in braces ({}).

The correct way to indicate dates in the form of text is to use the DATEVALUE() function. Also, if you are using an array constant to specify multiple "text" dates for the holidays argument, you must enclose the array constant within the DATEVALUE function. An example is provided in the "Function Reference," page 285.

Examples listing dates in the function

=NETWORKDAYS(DATEVALUE("1/1/92"),DATEVALUE("12/31/92"),

   DATEVALUE({"12/24/92","12/25/92"}))

-or-

=NETWORKDAYS(DATEVALUE("1/1/92"),DATEVALUE("12/31/92"),

   {33962,33963})

Examples using cell references

A1: 12/24/92 A2: 12/25/92

=NETWORKDAYS(DATEVALUE("1/1/92"),DATEVALUE("12/31/92"),A1:A2)

-or-

A1: 1/1/92 A2: 12/31/92 A3: 12/24/92 A4: 12/25/92

=NETWORKDAYS(A1,A2,A3:A4)

You cannot, however use the following:

A1: 12/24/92 C1: 12/25/92

=NETWORKDAYS(DATEVALUE("1/1/92"),DATEVALUE("12/31/92"),{A1,C1})

REFERENCES

"Function Reference," version 4.0, pages 94, 284-285


KBCategory: kbusage
KBSubcategory:

Additional reference words: 5.00 4.0 4.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 30, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.