WEEKNUM
Supported, behaves as documentedCategory: Date and time · Last tested 2026-07-04
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel | Yes | Not yet | n/a |
| Google Sheets | Yes | Not yet | n/a |
| LibreOffice Calc | Yes | Yes (24.2.7.2, 2026-07-04) | Supported, behaves as documented |
Executed test cases
LibreOffice Calc 24.2.7.2 (tested 2026-07-04)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =WEEKNUM(DATE(2024,1,1),1) | return_type 1 = US system, weeks start Sunday, week containing Jan 1 is always week 1. Verified via https://support.microsoft.com/en-us/office/weeknum-function-e5c43a03-b4ab-426c-b411-b18c13c75340 | 1 | 1 | Matched |
| =WEEKNUM(DATE(2024,1,1),2) | return_type 2 = same 'week containing Jan 1 is week 1' system, but weeks start Monday | 1 | 1 Jan 1, 2024 happens to BE a Monday, so it is both the week-1-by-Sunday-rule week AND the very first day of the week-1-by-Monday-rule week -- return_type 1 and 2 coincide at 1 for this specific date (see WEEKNUM_doc_example_* below for a date where they genuinely diverge) |
Matched |
| =WEEKNUM(DATE(2012,3,9)) | Microsoft's own documented example date/result for the default return_type (1) | 10 | 10 Per Microsoft docs, WEEKNUM(3/9/2012) = 10 with default return_type |
Matched |
| =WEEKNUM(DATE(2012,3,9),2) | Same date as WEEKNUM_doc_example_default but return_type=2 (Monday-start): Microsoft's own docs show this returns a DIFFERENT week number (11, not 10) for the identical date -- the genuine return_type divergence | 11 | 11 Per Microsoft docs, WEEKNUM(3/9/2012,2) = 11, one more than the return_type=1 result of 10 |
Matched |
| =WEEKNUM(DATE(2023,1,1),21) | return_type 21 uses 'System 2': the week containing the year's first Thursday is week 1 (ISO 8601), a genuinely different algorithm from return_types 1/2/11-17 (all of which use 'week containing Jan 1 = week 1'). This should match ISOWEEKNUM(DATE(2023,1,1)) exactly -- see ISOWEEKNUM.json | 52 | 52 Jan 1, 2023 is a Sunday; under the ISO rule it falls in the LAST ISO week (52) of 2022, not week 1 of 2023 |
Matched |
Docs & syntax
- Excel: official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation