I came across calweek module to emulate weeknum function (link). The weeknum() function in this module is compatible with Microsoft Excel's WEEKNUM formula function.