WEEK - Returning the Week Number of a Year

  • Last update:December 25, 2024
  • 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:

    • F1 represents that the week containing January 1st is the first week of the year, which starts on January 1st and ends on the last day of that week.

    • F7 represents that the first complete week is the first week of the year, which starts from the start date to the end date of the first complete week.

    iconNote:

    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.

    iconNote:
    The parameter can only be of the text or date type.

    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


     


    附件列表


    主题: Advanced Data Analysis
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    9s后關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy