Difference between revisions of "Documentation/How Tos/Calc: WEEKNUM ADD function"
From Apache OpenOffice Wiki
< Documentation | How Tos
(Initial content) |
|||
Line 8: | Line 8: | ||
=== Syntax: === | === Syntax: === | ||
<tt>'''WEEKNUM_ADD(date; mode)'''</tt> | <tt>'''WEEKNUM_ADD(date; mode)'''</tt> | ||
− | : returns the 'conventional' non-ISO week number, where week 1 is the week that contains January 1st. | + | : returns the 'conventional' non-ISO week number, where week 1 is the week that contains January 1st. |
: <tt>'''date'''</tt> is the date as a date-time serial number or as text. | : <tt>'''date'''</tt> is the date as a date-time serial number or as text. | ||
Line 14: | Line 14: | ||
: <tt>'''mode'''</tt> specifies which day is considered the first day of the week: <tt>'''1'''</tt> for Sunday, <tt>'''2'''</tt> for Monday. | : <tt>'''mode'''</tt> specifies which day is considered the first day of the week: <tt>'''1'''</tt> for Sunday, <tt>'''2'''</tt> for Monday. | ||
− | : <tt>'''WEEKNUM_ADD'''</tt> mimics the behaviour of the <tt>'''[[Documentation/How_Tos/Calc: WEEKNUM function|WEEKNUM]]'''</tt> function | + | : <tt>'''WEEKNUM_ADD'''</tt> mimics the behaviour of the <tt>'''WEEKNUM'''</tt> function in Excel. Calc's <tt>'''[[Documentation/How_Tos/Calc: WEEKNUM function|WEEKNUM]]'''</tt> function returns the international standard ISO8601 week number. |
=== Example: === | === Example: === |
Revision as of 09:02, 18 January 2008
WEEKNUM_ADD
Returns the non-ISO week number of a given date.
This function is only available if the Analysis AddIn is installed.
Syntax:
WEEKNUM_ADD(date; mode)
- returns the 'conventional' non-ISO week number, where week 1 is the week that contains January 1st.
- date is the date as a date-time serial number or as text.
- mode specifies which day is considered the first day of the week: 1 for Sunday, 2 for Monday.
- WEEKNUM_ADD mimics the behaviour of the WEEKNUM function in Excel. Calc's WEEKNUM function returns the international standard ISO8601 week number.
Example:
WEEKNUM_ADD("2010/01/07"; 2)
- returns 2. 7Jan10 is a Thursday, and 1Jan10 is the Friday of the preceding week.
See also:
Issues:
- WEEKNUM_ADD is called WEEKNUM in the forthcoming ODFF standard.