Since 366 divided by 7 = 52.286, how can the WeekOfYear function ever return 54?
The first example I found of this in the future is WeekOfYear ( Date ( 12 ; 31 ; 2028 ) ) = 54. The first day of 2028 falls on the last day of the week, and the last day of the year falls on the first day of the week — 2028 can have 54 weeks because it starts and ends on the extreme ends of incomplete weeks, in combination with being a leap year.
You almost have your answer. Round 52.286 up and you’ll get 53. Now, imagine that the 0.286 is split. Put one part at the beginning of the year and the other part at the end. The last Sunday of the year will be in week 54.
Ah, I was checking my calendar year after year and I couldn't find any year with dates in more than 53 weeks. You seem to have identified the only possible exception to be a leap year where January 1 falls on the last day of the week. Thanks very much.
Retrieving data ...