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

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Automated text replacement %s)
m
Line 41: Line 41:
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
[[Category: Documentation/Reference/Calc]]
+
[[Category: Documentation/Reference/Calc/Date and Time functions]]

Revision as of 06:51, 13 April 2010


WEEKS

Returns the number of weeks between two dates.

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

Syntax:

WEEKS(startdate; enddate; mode)

If mode is 0, WEEKS returns the number of whole weeks between startdate and enddate - that is INT(number_of_days_difference / 7).
If mode is 1, WEEKS identifies the Monday_to_Sunday week that startdate and enddate each lie in, and returns the difference between those weeks.
If startdate is after enddate the result will be negative.

Example:

WEEKS("2010-05-03"; "2010-05-17"; 0)

returns 2. Both dates are Mondays, and there are 14 days between them.

WEEKS("2010-05-04"; "2010-05-27"; 0)

returns 3; there are 23 days between the two dates.

WEEKS("2010-05-06"; "2010-05-17"; 1)

returns 2; 6 May 2010 lies in week 3-9 May, and 17 May 2010 lies in week 17-23 May, two weeks later.

WEEKS("2010-05-09"; "2010-05-10"; 1)

returns 1. 9 May 2010 is a Sunday and 10 May 2010 is the Monday of the following week.

Issues:

  • This function is not available in Excel.

Template:Documentation/SeeAlso

Personal tools