Week numbering without Analysis ToolPak

The late Frank Kabel was working on collecting formulas that would work without Analysis ToolPak. His replacement for the WEEKNUM function was a formula for ISO weeknumbers so strictly speaking it is not a substitute for the WEEKNUM function. Ron de Bruin and I have just updated the weeknumber page on Ron’s site.

ISO 8601:2000 Week Numbering Algorithm
[All weeks start on a Monday with Week 1 starting on Monday of the week with the first Thursday of the calendar year]

Here are two formulas for week numbering using the two WEEKNUM argument options:

Replacing =WEEKNUM(B4,1)
[Week 1 starts on 1-Jan, Week 2 starts on the following Sunday]

Replacing =WEEKNUM(B4,2)
[Week 1 starts on 1-Jan, Week 2 starts on the following Monday]

Thanks to Daniel M for the much more the comments that produce a much more efficient approach to the WEEKNUM replacements than used by the original formulas. This should make our DataRefiner Addin a lot more efficient when used on large data tables.

To complete the “usual suspects” list:

Simple Week Numbering:
[Week 1 starts on 1-Jan, Week 2 starts 8-Jan, Week 53 has only 1 or (Leap Years) 2 days]

The Analysis ToolPak WEEKNUM function algorithms suffer from having first and last weeks without 7 days and in both cases there can be years with Week 54. Simple week numbering starts on different days of the week and always has week 53 with one or two days. With ISO Week numbers week 1 may start as early as 29-Dec of the preceding calendar year but all weeks will have 7 days starting on a Monday; much better for payroll and statistical comparisons. Some calendar years will have 52 ISO weeks and some will have 53 ISO weeks. The ISO week numbering system is now being introduced in the European Union.

Ron de Bruin and I have constructed an Excel workbook week numbering Calendar creator using all four systems and this is available for download with unrestricted use from:


There are small amendments to the original version with fewer long formulas used.

For making this or any workbook independent of John Green’s ISOYEARSTART UDF you can use the following Excel “translation” of that UDF:


Or, if A1 contains a four digit year number:

Without resorting to a text solution, no formula can correct the 1900 Leap Year error, although our Week Numbers Calendar does disguise the error.

Reliance on Analysis ToolPak is a major annoyance because the Addin may not be installed or checked. A default Excel installation has it unchecked. Also, there are international difficulties where you insert ATP formulas by VBA. Use of simpler User Defined Functions is not a robust solution when Security settings are Very High or High.

Until we synchronise the Earth’s rotation with the Earth’s Orbit around the Sun (Excel Version ?) we’ll have to live with the individual deficiencies of the four week numbering systems.