WEEKNUM Function in Microsoft Excel: Syntax, Examples & Compatibility
Learn how to calculate a calendar week number for reports without confusing it with ISO week numbering in Microsoft Excel. Includes syntax, two verified-by-reasoning results, troubleshooting and portability notes.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: WEEKNUM returns a week-of-year number under a selected rule. Default mode 1 starts weeks on Sunday and makes the week containing January 1 week 1. Mode 2 starts Monday but keeps that rule; mode 21 uses ISO week numbering.
Availability and version history
- Introduced: Introduction version not established by the official history reviewed.
- Availability: Official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
- Checked: October 14, 2026; official WEEKNUM reference. Documentation check, not a new native test; existing example-verification notes retain their scope.
Syntax and input setup
=WEEKNUM(serial_number, [return_type])
Examples use English function names and comma separators. Enter formula inputs exactly as shown, keep outputs outside the input cells, and use the specified date or numeric output format.
The date is required and the numbering mode is optional. Enter dates using DATE or validated numeric date cells, and display the result as Number. The returned number alone does not identify which week-year or convention a report intends.
Two original worked controls
=WEEKNUM(DATE(2026,1,1),2)
=WEEKNUM(DATE(2026,1,5),2)
Expected results are 1 and 2. Under mode 2, the opening partial week contains Thursday January 1, and Monday January 5 begins week 2.
The rule that January 1 belongs to week 1 applies to System 1 modes such as 2. It is not universal across every WEEKNUM mode: ISO mode 21 can assign early January to the preceding week-year.
Two systems and all documented modes
| return_type | Week begins | System |
|---|---|---|
| 1 or omitted | Sunday | 1 |
| 2 or 11 | Monday | 1 |
| 12 | Tuesday | 1 |
| 13 | Wednesday | 1 |
| 14 | Thursday | 1 |
| 15 | Friday | 1 |
| 16 | Saturday | 1 |
| 17 | Sunday | 1 |
| 21 | Monday | 2, ISO |
System 1 calls the week containing January 1 week 1. System 2 calls the week containing the year’s first Thursday week 1. Both mode 2 and mode 21 start Monday, but that does not make their year-boundary results equivalent.
Mode 3 is not listed for WEEKNUM, even though it is valid for WEEKDAY. Reusing one function’s mode numbers in another function can therefore cause a documented error.
Example: Sunday and Monday starts split a boundary differently
=WEEKNUM(DATE(2026,1,4))
=WEEKNUM(DATE(2026,1,4),2)
Expected results are 2 and 1. Sunday January 4 starts a new week in the default Sunday-first system but remains in the first partial week in the Monday-first system. On Monday January 5, both System 1 conventions give 2.
State the convention in a column heading or report description. A column named only Week can otherwise conceal a difference that appears on exactly the dates a reporting boundary matters.
Advanced example: distinguish ISO week and calendar year
Create A2:A4 with these DATE formulas and calculate the three outputs shown:
| Date formula | WEEKNUM(A2,2) |
WEEKNUM(A2,21) |
ISO week-year |
|---|---|---|---|
=DATE(2021,1,1) |
1 | 53 | 2020 |
=DATE(2021,1,4) |
2 | 1 | 2021 |
=DATE(2024,12,30) |
53 | 1 | 2025 |
Fill the formulas down with the corresponding row reference. The January 1 date belongs to ISO week 53 of 2020, and December 30, 2024 belongs to ISO week 1 of 2025. Simply combining YEAR(A2) with the ISO week number would assign the wrong year to those two dates.
These outputs follow the first-Thursday rule and were independently calculated, rather than captured from native Excel.
Advanced example: derive a consistent ISO week-year key
For date-only A2:
=YEAR(A2-WEEKDAY(A2,2)+4)
The expression moves to the Thursday of the containing Monday-first week, then extracts its year. That Thursday determines the ISO week-year. The expected years for the preceding table are 2020, 2021 and 2025.
A combined report label is:
=YEAR(A2-WEEKDAY(A2,2)+4)&"-W"&TEXT(WEEKNUM(A2,21),"00")
Expected labels are 2020-W53, 2021-W01 and 2025-W01. The two-digit week format keeps labels consistently shaped; it does not alter the underlying week calculation.
This is a derived reporting formula using the documented ISO convention. It does not change the date’s calendar year or certify every imported text, fractional timestamp or historical serial boundary.
Advanced check: group consecutive dates across New Year
For December 28, 2020 through January 3, 2021, each date has ISO key 2020-W53. Monday January 4, 2021 starts 2021-W01. Splitting the first group solely by calendar YEAR would divide one ISO week into two unrelated buckets.
For a System 1 report, that cross-year grouping may intentionally be different. Do not silently change a report from mode 2 to mode 21 just because ISO is another recognized standard; preserve the convention the report actually requires.
Errors and validation
Microsoft documents #NUM! for a date serial outside the valid date range or a return_type absent from its table. Return_type 3 therefore has documented expected #NUM!, unlike WEEKDAY’s mode 3.
A plausible week number is not proof that the date parsed correctly. Use explicit DATE controls at January 1, the first Monday and late December, then confirm the data uses the same convention. The official function supplies a week number; the report author supplies the meaning of a combined week-year label.
Related guides and verification
WEEKDAY in Microsoft Excel | WEEKDAY in Google Sheets | YEAR in Microsoft Excel | YEAR in Google Sheets | editorial testing standards
The full manuscript and original worked formulas were reviewed on October 14, 2026. The approved availability/history section is unchanged. Expected results are independently calculated date/arithmetic models or explicitly documented rules, not native Excel output. Current-clock formulas have conditional rather than fixed outputs. Client-specific time-zone, mixed-type and boundary behavior is not inferred from another spreadsheet.