Which week is the fetch date of the month

  • Last update:  2021-10-24
  • I. Overview

    Given that we have a function called WEEK() to retrieve the WEEK of the year in which the date is located, how do we obtain the WEEK of the month in which the date is located?

    II.Train of thought

    Use DATEINMONTH() to obtain the date of the first day in the month. Use WEEKDAY() to obtain the number of the first day in the month. Add the number of days for querying the date to the number of days for querying the date.

    III.Steps

    1) Insert the formula RANGE(date(2018, 12, 1), today()) in cell A1 and set the extension direction of the cell to Vertical:

    1.jpg

    Insert the formula in cell B1:ROUNDUP((DAY(A1) + (IF(WEEKDAY(DATEINMONTH(A1, 1))) = 0, 7, WEEKDAY(DATEINMONTH(A1, 1)))) - 1) / 7, 0)

    2.jpg

    Note: The calculation result of this formula starts from Monday. If the calculation starts from Sunday,the formula will change to: ROUNDUP((DAY(A1) + (IF(WEEKDAY(DATEINMONTH(A1, 1))) = 0, 7, WEEKDAY(DATEINMONTH(A1, 1))))) / 7, 0)) ROUNDUP((DAY(A1) + (IF(WEEKDAY(DATEINMONTH(A1, 1))) = 0, 7, WEEKDAY(DATEINMONTH(A1, 1)))

    3) Save the template and click Pagination Preview.

    For the completed template, see: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Parameter\Which_week_is_the_fetch_date_of_the_month.cpt

    Click to download the template:

    Which_week_is_the_fetch_date_of_the_month.cpt


    Common date references: Common date processing functions.

    IV. Effect preview

    1) PC

    3.jpg

    2) Mobile 

    4.jpg

    Attachment List


    Theme: Parameter
    Already the First
    • Helpful
    • Not helpful
    • Only read

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

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

    不再提示

    10s後關閉

    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