WEEKNUM
Supported, behaves as documentedCategory: Date and time · Last tested 2026-09-01
Real compatibility results for the WEEKNUM function: executed in Excel for the web, Google Sheets and LibreOffice Calc, with desktop Excel behavior from Microsoft’s official documentation (we do not run desktop Excel — Excel for the web is a different application and is executed separately). Syntax and links to that documentation are below.
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel (desktop) | Yes | No — documented only | n/a |
| Excel for the web | — | Yes (recalc, 2026-09-01) | Supported, behaves as documented |
| Google Sheets | Yes | Yes (Drive import, 2026-08-29) | Supported, behaves as documented |
| LibreOffice Calc | Yes | Yes (25.8.7.3, 2026-07-29) | Supported, behaves as documented |
LibreOffice version history
We executed the same test cases under each LibreOffice release to show exactly when WEEKNUM’s support changed — not documentation claims, real results.
| LibreOffice version | Verdict | Tested |
|---|---|---|
| 24.2.0.3 | Supported, behaves as documented | 2026-08-29 |
| 24.8.7.2 | Supported, behaves as documented | 2026-08-29 |
| 25.2.0.3 | Supported, behaves as documented | 2026-08-29 |
| 25.8.7.3 | Supported, behaves as documented | 2026-07-29 |
Executed test cases
Excel for the web (executed 2026-09-01 via OneDrive recalculation)
These values come from Excel for the web, not from desktop Excel. They are two different implementations of the calculation engine, and this run measured only the web one: the corpus was uploaded to OneDrive as .xlsx, recalculated by Excel for the web on open, and downloaded again for readback. Excel for the web is a rolling service with no pinnable version, so the run is identified by its date. Where a value here disagrees with the Expected column — which is Microsoft’s documentation of the desktop product — we cannot tell you whether the web engine diverges from the desktop one or the documentation is wrong about both, because we do not run desktop Excel.
| 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 | 1ProvenanceJan 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 | 10ProvenancePer 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 | 11ProvenancePer 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 | 52ProvenanceJan 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 |
Google Sheets (executed 2026-08-29 via Drive import)
Google Sheets is a rolling service with no pinnable version, so this run is identified by its date. The corpus was imported to Drive as .xlsx, recalculated by Sheets, and exported back for readback.
| 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 | 1ProvenanceJan 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 | 10ProvenancePer 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 | 11ProvenancePer 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 | 52ProvenanceJan 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 |
LibreOffice Calc 25.8.7.3 (tested 2026-07-29)
| 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 | 1ProvenanceJan 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 | 10ProvenancePer 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 | 11ProvenancePer 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 | 52ProvenanceJan 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 (desktop): official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation