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

From Apache OpenOffice Wiki
Jump to: navigation, search
m
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE: WEEKS function}}
 +
{{Documentation/CalcFunc DateTimeTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_DAYSINYEAR_function
 +
|NextPage=Documentation/How_Tos/Calc:_WEEKSINYEAR_function
 +
}}__NOTOC__
  
 
== WEEKS ==
 
== WEEKS ==
Line 30: Line 35:
 
* This function is not available in Excel.
 
* This function is not available in Excel.
  
{{Documentation/SeeAlso|
+
{{SeeAlso|EN|
 
* [[Documentation/How_Tos/Calc: DAYS function|DAYS]]
 
* [[Documentation/How_Tos/Calc: DAYS function|DAYS]]
 
* [[Documentation/How_Tos/Calc: MONTHS function|MONTHS]]
 
* [[Documentation/How_Tos/Calc: MONTHS function|MONTHS]]

Latest revision as of 14:02, 30 January 2024



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.



See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_WEEKS_function&oldid=259705"
Views
Personal tools
Navigation
Tools