简体   繁体   English

Excel weeknum 函数显示错误的周数?

[英]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: Excel 给了我这个:

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

Both dates cannot have a week number of 1. What am i doing wrong?两个日期的周数都不能为 1。我做错了什么?

I encountered the same concern and stumbled on this thread too (Microsoft Excel Online).我遇到了同样的问题并偶然发现了这个线程(Microsoft Excel Online)。

For this case, ISOWEEKNUM worked for me, please note that I've set my date settings to English (United Stated).对于这种情况,ISOWEEKNUM 对我有用,请注意我已将日期设置设置为英语(美国)。

As long as there is no precise answer for this post, I would like to mention that your issue is all documented in WEEKNUM .只要这篇文章没有确切的答案,我想提一下,您的问题都记录在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.系统 1 包含 1 月 1 日的那一周是一年中的第一周,并编号为第 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.系统 2 包含一年中第一个星期四的那一周是一年的第一周,编号为第 1 周。该系统是 ISO 8601 中规定的方法,通常称为欧洲周编号系统。

Syntax WEEKNUM(serial_number,[return_type])语法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.将按照 ISO 8601 中的定义进行计算,因为Return_type 21 是系统 2 中唯一的一个。


ISOWEEKNUM 等周数

=ISOWEEKNUM("26/01/2017")

Will also do it.也会做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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