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

From Apache OpenOffice Wiki
Jump to: navigation, search
(See also:)
Line 32: Line 32:
 
'''[[Documentation/How_Tos/Calc: MONTHS function|MONTHS]]''',
 
'''[[Documentation/How_Tos/Calc: MONTHS function|MONTHS]]''',
 
'''[[Documentation/How_Tos/Calc: YEARS function|YEARS]]'''
 
'''[[Documentation/How_Tos/Calc: YEARS function|YEARS]]'''
 +
 +
'''[[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]'''
  
 
'''[[Documentation/How_Tos/Calc: Date & Time functions|Date & Time functions]]'''
 
'''[[Documentation/How_Tos/Calc: Date & Time functions|Date & Time functions]]'''
  
'''[[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]'''
+
[[Documentation/How_Tos/Calc: Functions listed alphabetically|'''Functions listed alphabetically''']],
 +
[[Documentation/How_Tos/Calc: Functions listed by category|'''Functions listed by category''']]
  
 
=== Issues: ===
 
=== Issues: ===
 
* This function is not available in Excel.
 
* This function is not available in Excel.

Revision as of 07:15, 12 September 2008


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.


See also:

DAYS, MONTHS, YEARS

Date & Time overview

Date & Time functions

Functions listed alphabetically, Functions listed by category

Issues:

  • This function is not available in Excel.
Personal tools