Extracted Data
Overview
Syntax | WEEK(Serial_number,"F1") or WEEK(Serial_number,"F7") | Returns the week number of a year. |
Parameter 1 | Serial_number | Represents the date entered. The Serial_number parameter can also be of the serial number type. For example, January 1, 1998 is stored as the serial number 35796 in the 1900 date system. |
Parameter 2 | "F1"/"F7" | Determines the date range for the first week of the year:
![]() 1. The Week Start from setting in the decision-making platform allows you to determine the start date of the week as Sunday/Monday, which will affect the date range of the first week. For details, see "Example" in this document. 2. Currently only two writing styles (F1 and F7) are supported. If F1/F7 is not entered, the default value is F7. |
Notes
The function allows the parameters in WEEK(Serial_number,"F1"/"F7") to be empty. That is to say, you can simply use WEEK(). When the parameter is empty, take week number of the year of the current system server time.
The first parameter is of the date or text type by default, and the second is of the text type by default.
The second parameter is case-insensitive.
Example
F1 means that the week starts from Monday, taking the week including January 1st as the first week, and the first week starts from January 1st to the last day of this week.
F7 means that the week starts from Sunday, taking the first complete week within the year as the first week of the year; when the Monday of the week including January 1st of the year falls in the previous year, the current week is considered as the 52nd week.
For example, 2021/01/03
If you set Week Start from to Monday on the platform,
the following table describes specific content.
Date | 2021-01-03 | Description | 2021-01-04 | 2021-01-05 |
WEEK (with parameter F7) | 52 | Starting from Monday, the first complete week is from 01-04 to 01-10, so 01-03 is displayed as 52. | 1 | 1 |
WEEK (with parameter F1) | 1 | The first week starts from January 1st, and the first week is from January 1st to January 3rd. | 2 | 2 |
If you set Week Start from to Sunday on the platform, the following table describes specific content.
Date | 2021-01-03 | Description | 2021-01-04 | 2021-01-05 |
WEEK (with parameter F7) | 1 | Starting from Sunday, the first complete week is from January 3rd to January 9th, so January 3rd is displayed as 1. | 1 | 1 |
WEEK (with parameter F1) | 2 | The first week starts from January 1st, so the first week is from January 1st to 2nd and the second week is from January 3rd to 9th. | 2 | 2 |
Other examples:
Formula | Result | Note |
WEEK() | 52 | The corresponding system server time is 2010-01-01 15:36:25. |
WEEK("2010-1-1") | 52 | |
WEEK("2010/1/1","F1") | 1 | |
WEEK("2010/1/6") | 1 | |
WEEK(35796) | 52 |
Real-Time Data
Overview
Syntax | WEEK(Serial_number) | Returns the week number of a year. |
Parameter | Serial_number | Represents the date entered. ![]() |
Notes
The function allows the parameter in WEEK(Serial_number) to be empty. That is to say, you can simply use WEEK(). When the parameter is empty, take the week number of the year of the current system server time.
The parameter can be of the default date or text type.
Example
For details, see the example in "Extracted Data" in this document.
Other examples:
Formula | Result | Note |
WEEK() | 52 | The corresponding system server time is 2010-01-01 15:36:25. |
WEEK("2010-01-01") | 52 | |
WEEK("2010-01-06") | 1 |