Difference between revisions of "Documentation/How Tos/Calc: NETWORKDAYS function"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
m (Example:: ISO date)
Line 12: Line 12:
  
 
=== Example: ===
 
=== Example: ===
<tt>'''NETWORKDAYS("2008/09/05"; "2008/09/08")'''</tt>
+
<tt>'''NETWORKDAYS("2008-09-05"; "2008-09-08")'''</tt>
 
: returns <tt>'''2'''</tt>. 5Sep08 is a Friday and 8Sep08 is a Monday. The Friday and Monday are counted as working days; Saturday and Sunday are ignored.
 
: returns <tt>'''2'''</tt>. 5Sep08 is a Friday and 8Sep08 is a Monday. The Friday and Monday are counted as working days; Saturday and Sunday are ignored.
  
<tt>'''NETWORKDAYS("2008/09/05"; "2008/09/8"; D1:D2)'''</tt>
+
<tt>'''NETWORKDAYS("2008-09-05"; "2008-09-8"; D1:D2)'''</tt>
 
: where D1 contains 8Sep08 and D2 contains 25Dec08, returns <tt>'''1'''</tt>. 5Sep08 is a Friday which is a working day; Saturday and Sunday are ignored; 8Sep08 is a Monday but is specified as a holiday (in cell D1).
 
: where D1 contains 8Sep08 and D2 contains 25Dec08, returns <tt>'''1'''</tt>. 5Sep08 is a Friday which is a working day; Saturday and Sunday are ignored; 8Sep08 is a Monday but is specified as a holiday (in cell D1).
  

Revision as of 07:34, 15 February 2008


NETWORKDAYS

Returns the number of workdays between two dates.

This function is only available if the Analysis AddIn is installed.

Syntax:

NETWORKDAYS(startdate; enddate; hols_range)

returns the number of workdays between startdate and enddate (inclusive).
Saturday and Sunday are assumed to be non-working days. hols_range (optional) is a range containing dates of other non-working days.

Example:

NETWORKDAYS("2008-09-05"; "2008-09-08")

returns 2. 5Sep08 is a Friday and 8Sep08 is a Monday. The Friday and Monday are counted as working days; Saturday and Sunday are ignored.

NETWORKDAYS("2008-09-05"; "2008-09-8"; D1:D2)

where D1 contains 8Sep08 and D2 contains 25Dec08, returns 1. 5Sep08 is a Friday which is a working day; Saturday and Sunday are ignored; 8Sep08 is a Monday but is specified as a holiday (in cell D1).

See also:

WORKDAY, DAYS

Date & Time functions

Date & Time overview

Personal tools