简体   繁体   中英

Excel weeknum function showing wrong week number?

I have a workbook:

Column A       Column B
01/01/2017     =WEEKNUM(A2,2)
26/01/2017     =WEEKNUM(A3,2)

I am trying to get the week number starting monday. Excel gives me this:

01/01/2017      1
26/01/2017      1

Both dates cannot have a week number of 1. What am i doing wrong?

I encountered the same concern and stumbled on this thread too (Microsoft Excel Online).

For this case, ISOWEEKNUM worked for me, please note that I've set my date settings to English (United Stated).

As long as there is no precise answer for this post, I would like to mention that your issue is all documented in WEEKNUM .

There are two systems used for this function:

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 as week 1. This system is the methodology specified in ISO 8601, which is commonly known as the European week numbering system.

Syntax WEEKNUM(serial_number,[return_type])

Return_type  Week begins on  System 
...
21           Monday          2

Given this,

=WEEKNUM("26/01/2017",21)

Will calculate as defined in ISO 8601 since Return_type 21 is the only one with System 2.


ISOWEEKNUM

=ISOWEEKNUM("26/01/2017")

Will also do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM