WEEKNUM

WEEKNUM calculates the week number of the year for the internal date value as defined in ODF OpenFormula and compatible with other spreadsheet applications.

Supported are two week numbering systems:

System

Description

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.


Syntax

WEEKNUM(Число; РСТим)

АргумСнт число: это Π²Π½ΡƒΡ‚Ρ€Π΅Π½Π½Π΅Π΅ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ Π΄Π°Ρ‚Ρ‹.

Mode sets the start of the week and the week numbering system. This parameter is optional, if omitted the default value is 1.

System

Mode

Day of the week

System 1

1

Sunday

2

Monday

11

Monday

12

Tuesday

13

Wednesday

14

Thursday

15

Friday

16

Saturday

17

Sunday

System 2

21

Monday (ISO 8601)

150

(ISO 8601, for interoperability with Gnumeric)


note

ΠŸΡ€ΠΈ Π²Π²ΠΎΠ΄Π΅ Π΄Π°Ρ‚ ΠΊΠ°ΠΊ части Ρ„ΠΎΡ€ΠΌΡƒΠ», косыС Ρ‡Π΅Ρ€Ρ‚Ρ‹ ΠΈΠ»ΠΈ Ρ‚ΠΈΡ€Π΅, ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅ΠΌΡ‹Π΅ Π² качСствС Ρ€Π°Π·Π΄Π΅Π»ΠΈΡ‚Π΅Π»Π΅ΠΉ Π΄Π°Ρ‚, ΠΈΠ½Ρ‚Π΅Ρ€ΠΏΡ€Π΅Ρ‚ΠΈΡ€ΡƒΡŽΡ‚ΡΡ ΠΊΠ°ΠΊ арифмСтичСскиС ΠΎΠΏΠ΅Ρ€Π°Ρ‚ΠΎΡ€Ρ‹. ΠŸΠΎΡΡ‚ΠΎΠΌΡƒ Π΄Π°Ρ‚Ρ‹, Π²Π²Π΅Π΄Π΅Π½Π½Ρ‹Π΅ Π² этом Ρ„ΠΎΡ€ΠΌΠ°Ρ‚Π΅, Π½Π΅ Ρ€Π°ΡΠΏΠΎΠ·Π½Π°ΡŽΡ‚ΡΡ ΠΊΠ°ΠΊ Π΄Π°Ρ‚Ρ‹ ΠΈ приводят ΠΊ ΠΎΡˆΠΈΠ±ΠΎΡ‡Π½Ρ‹ΠΌ вычислСниям. Π§Ρ‚ΠΎΠ±Ρ‹ Π΄Π°Ρ‚Ρ‹ Π½Π΅ ΠΈΠ½Ρ‚Π΅Ρ€ΠΏΡ€Π΅Ρ‚ΠΈΡ€ΠΎΠ²Π°Π»ΠΈΡΡŒ ΠΊΠ°ΠΊ части Ρ„ΠΎΡ€ΠΌΡƒΠ», ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΡŽ DATE, Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€ DATE (1954;7;20) ΠΈΠ»ΠΈ помСститС Π΄Π°Ρ‚Ρƒ Π² ΠΊΠ°Π²Ρ‹Ρ‡ΠΊΠΈ ΠΈ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ Π½ΠΎΡ‚Π°Ρ†ΠΈΡŽ ISO 8601, Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€ "1954-07-20". Π˜Π·Π±Π΅Π³Π°ΠΉΡ‚Π΅ использования Ρ„ΠΎΡ€ΠΌΠ°Ρ‚ΠΎΠ² Π΄Π°Ρ‚Ρ‹, зависящих ΠΎΡ‚ Π»ΠΎΠΊΠ°Π»ΡŒΠ½Ρ‹Ρ… настроСк, Ρ‚Π°ΠΊΠΈΡ… ΠΊΠ°ΠΊ "07/20/54", расчёт ΠΌΠΎΠΆΠ΅Ρ‚ привСсти ΠΊ ошибкам, Ссли Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚ Π·Π°Π³Ρ€ΡƒΠΆΠ΅Π½ Π² соотвСтствии с ΠΈΠ½Ρ‹ΠΌΠΈ Π»ΠΎΠΊΠ°Π»ΡŒΠ½Ρ‹ΠΌΠΈ настройками.


tip

Unambiguous conversion is possible for ISO 8601 dates and times in their extended formats with separators. If a #VALUE! error occurs, then unselect Generate #VALUE! error in - LibreOffice Calc - Formula, button Details... in section "Detailed Calculation Settings", Conversion from text to number list box.


Example

=WEEKNUM(DATE(1995;1;1);1) returns 1

=WEEKNUM(DATE(1995;1;1);2) returns 52. If the week starts on Monday, Sunday belongs to the last week of the previous year.

=WEEKNUM(DATE(1995;1;1);21) returns 52. Week 1 starts on Monday, 1995-01-02.

=WEEKNUM(DATE(1999;1;1);21) returns 53. Week 1 starts on Monday, 1999-01-04.