Skip to main content

WEEKNUM() not ISO proof

  • October 13, 2016
  • 3 replies
  • 69 views

Forum|alt.badge.img+19

Hi, to be honest I’m not sure if it actually is a bug, but this function does not follow the ISO standard of numbering weeks.

For example, today (2016-10-13) should be week 41, but the function returns 42. Probably because the first week of this year was week 53 according to the international standards.

This topic has been closed for replies.

3 replies

Forum|alt.badge.img+19
  • Author
  • Inspiring
  • October 13, 2016

Never mind: I just found that DATETIME_FORMAT(NOW(), ‘W’) does return the ISO week number.

A reference in the formula editor (for WEEKNUM) would be helpful. :slightly_smiling_face:


Forum|alt.badge.img
  • New Participant
  • May 30, 2021

That’s great, the only problem is that when using DATETIME_FORMAT, Monday is the first the of the week, but I just figured out a way to solve this (ie to make Sunday the first day AND use ISO week numbers), by adding +1 days like that:

VALUE(DATETIME_FORMAT(DATEADD(Date,1,"days"),"W"))

Note I used VALUE() to convert the week number into an actual number, not string
Hope this helps others too !


airballer86
Forum|alt.badge.img+18
  • Known Participant
  • January 3, 2025

That’s great, the only problem is that when using DATETIME_FORMAT, Monday is the first the of the week, but I just figured out a way to solve this (ie to make Sunday the first day AND use ISO week numbers), by adding +1 days like that:

VALUE(DATETIME_FORMAT(DATEADD(Date,1,"days"),"W"))

Note I used VALUE() to convert the week number into an actual number, not string
Hope this helps others too !


QQ here, when I use the above it still put 12/29-12/31 as 2024-01. is 2024-53 not possible?