WEEKNUM_OOO

WEEKNUM_OOO 计算内部日期值中一年的周数。

批注图标

This function exists for interoperability with LibreOffice releases older than 5.1.0 and OpenOffice.org. It calculates week numbers for a week numbering system in that week number 1 is the week that contains the January 4th. This function does not provide interoperability with other spreadsheet applications. For new documents use the WEEKNUM or ISOWEEKNUM function instead.


语法

WEEKNUM(Number; Mode)

value」是日期的内部序列数。

mode」参数指定的是计算方式,即指定哪一天应该是每周的第一天。

1 = 星期天

2 = Monday (ISO 8601)

any other value = Monday (ISO 8601)

批注图标

将日期作为公式一部分输入时,日期分隔符 (斜杠与短横线) 会被理解为算术运算符。因此,按此格式输入的日期无法正确识别为日期,导致错误计算。要保持日期作为公式一部分,请使用 DATE 函数,例如「DATE(1954;7;20)」或将日期放在引号内,使用 ISO 8601 标记法,例如「1954-07-20」。请避免使用受区域影响的日期格式,例如「07/20/54」,在其他区域设置下加载文档,会导致计算错误。


提示图标

支持 ISO 8601 日期时间格式 (及其分隔符扩展格式) 的无歧义转换。如果出现 #VALUE! 错误,请在「 - LibreOffice Calc - 公式」「详细计算设置」区域的「详细信息...」 按钮,「文本转换为数字」列表框,取消选择「生成 #VALUE! 错误」。


示例

=WEEKNUM_OOO(DATE(1995;1;1);1) returns 1

=WEEKNUM_OOO(DATE(1995;1;1);2) returns 52. Week 1 starts on Monday, 1995-01-02.