calculate the month from the year and week number in excel

前端 未结 3 825
野的像风
野的像风 2020-12-13 16:29

In Excel 2007 I have a Year number and Week number and I want to work out the Month number.

The catch is that in my case the start of every week is a monday, so some

3条回答
  •  伪装坚强ぢ
    2020-12-13 17:10

    I suggest the following approach

    • Determine the (ISO) week of January 1st (see this page) [in cell C4]

      =INT((B4-DATE(YEAR(B4-WEEKDAY(B4-1)+4),1,3)+WEEKDAY(DATE(YEAR(B4-WEEKDAY(B4-1)+4),1,3))+5)/7) (assuming B4 =DATE([Year],1,1))

    • Calculate the day on which week 1 starts [in cell D4]

      =IF(C4=1,B4-WEEKDAY(B4,3),B4+7-WEEKDAY(B4,3))

    • Determine the Monday of the week in question and the corresponding month

      =MONTH(D4+7*([Week]-1))

提交回复
热议问题