Bug 147654 - WEEKNUM function
Summary: WEEKNUM function
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.8.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-25 13:13 UTC by besancon4me
Modified: 2022-02-25 15:23 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description besancon4me 2022-02-25 13:13:26 UTC
Today is 25th February 2022.
The first day of the year was a Saturday, so according to the ISO standard -as used by Google calendar etc.) today should be week 8.

WEEKNUM
System 1 = The week containing January 1 is the first week of the year, and is numbered week 1.
System 2 = The week containing the first Thursday of the year is the first week of the year, and is numbered week 1. That means that week number 1 of any year is the week that contains January 4th. ISO 8601 defines this system and that the week starts on Monday.

The default is said to be 1, so =WEEKNUM(TODAY()) should return a value of 9, which it does.
But  =WEEKNUM(TODAY(),2) should return the ISO 8601 number, which is 8. In fact, it also returns 9.
Comment 1 Eike Rathke 2022-02-25 15:23:19 UTC
Second parameter Mode argument 2 does *not* denote ISO 8601 week numbering. It specifies that the week starts on Monday for System 1. For ISO 8601 week numbering use either Mode 21 for System 2 or the function ISOWEEKNUM()

See https://help.libreoffice.org/latest/en-GB/text/scalc/01/func_weeknum.html?DbPAR=CALC#bm_id3159161