Week numbers in LibreOffice Calc

How to get the week number from a date

To get the ISO week number (1-53) for a date in cell A1, use =WEEKNUM(A1; 21).

21 is a code that identifies ISO week numbers among other week numbering scheme.

To get the corresponding year, use =YEAR(A1 - WEEKDAY(A1; 2) + 4).

Read more about WEEKNUM() and WEEKDAY() on the LibreOffice help site.

How to get the date from a week number

To get the date of the Monday in a week, use =DATE(A1; 1; -3 + 7 * B1 - WEEKDAY(DATE(A1; 1; 4); 2) + 1).

Cell A1 contains the four-digit year (e.g. 2013), and cell B2 contains the week number (1-53).

How to get the number of weeks in a year

To get the of ISO weeks in a year (i.e. the number of the last week), use =WEEKSINYEAR(A1). Cell A1 contains the four-digit year (e.g. 2012).