← Functions
weeknumdatefunctionsbeginner

Excel WEEKNUM Function

WEEKNUM returns which week of the year a date falls in, based on a numbering system you choose.

WEEKNUM takes a date and returns the week number it falls in, from 1 to 54. By default, week 1 is whichever week contains January 1, and weeks start on Sunday. That default surprises a lot of people who expect ISO week numbering (Monday start, week 1 defined by the first Thursday of the year). If you need ISO weeks, skip ahead to the ISOWEEKNUM comparison below.

Available in: Excel 365, Excel 2021, Excel 2019, Excel 2016, and Excel 2010 or later. The ISO week option (return_type 21) requires Excel 2010 or later. Excel 2007 and earlier do not support type 21 and return #NUM! if you try to use it.

Syntax

=WEEKNUM(serial_number, [return_type])
ParameterRequiredDescription
serial_numberYesThe date you want the week number for. Can be a real date, a cell reference to a date, or a date typed as text that Excel recognizes.
return_typeNoA number that sets which day starts the week and which week-numbering system to use. Defaults to 1 (week starts Sunday, week containing January 1 is week 1) if you leave it out.

WEEKNUM defaults to return_type 1, which is not the ISO 8601 standard most of the world uses for week numbers. If your organization reports on ISO weeks (Monday start, first Thursday rule), WEEKNUM with the default argument will silently return numbers that don't match. Use return_type 21 for ISO-style weeks within WEEKNUM, or switch to ISOWEEKNUM entirely.

Basic Example

You're building a weekly sales report and need to tag each order with its week number so you can group totals in a pivot table.

=WEEKNUM(B2)

// B2 = the order date, 3/15/2026

March 15, 2026 is a Sunday. Since the default return type starts weeks on Sunday and counts the week containing January 1 as week 1, this formula returns 12. Drag it down the column and every order gets tagged with its week, ready to group in a pivot table or a SUMIFS formula.

How WEEKNUM Works

return_type Sets Which Day Starts the Week

The second argument controls two things at once: which day the week starts on, and in some cases, which numbering system applies. Type 1 starts weeks on Sunday. Type 2 starts weeks on Monday. Types 11 through 17 let you start the week on any day from Monday through Sunday. Type 21 switches to the ISO 8601 system entirely, where weeks start Monday and week 1 is the week containing the year's first Thursday.

Week 1 Always Contains January 1

Under the default system, week 1 isn't the first full week of the year. It's whichever week, however partial, contains January 1. In 2026, January 1 falls on a Thursday, so week 1 runs from Sunday, December 28, 2025 through Saturday, January 3, 2026, even though most of that week belongs to the previous calendar year.

WEEKNUM Can Return 53 or 54, Not Just 52

A year with 52 weeks of 7 days each only accounts for 364 days. The leftover day (or two, in a leap year) means some years spill into week 53, and under certain return types, week 54. Don't hardcode 52 as a maximum anywhere in a formula that references WEEKNUM.

It Accepts Text Dates, But Format Matters

WEEKNUM will accept a date typed as text, like "3/15/2026", and convert it automatically if your regional date settings match the format. This is fragile. A date typed as 15/3/2026 on a U.S. system reads as invalid and throws an error, since there's no 15th month. Reference an actual date cell instead of typing dates as text whenever you can.

Common Use Cases

Group orders by week for a pivot table

Add a helper column that tags every row with a week number, then use that column as a pivot field.

=WEEKNUM(A2)   // returns the week number for the order date in A2

Flag orders placed in the current week

Compare a row's week number to today's week number to highlight current activity in a dashboard.

=WEEKNUM(A2) = WEEKNUM(TODAY())

// A2         = the order date being checked
// TODAY()    = today's date, evaluated fresh each time the sheet opens

Build a readable week label

Combine YEAR and WEEKNUM to create a label like "2026-W12" for chart axes or report headers.

=TEXT(YEAR(A2), "0000") & "-W" & TEXT(WEEKNUM(A2), "00")

// YEAR(A2)      = the year the date falls in
// WEEKNUM(A2)   = the week number within that year

Match a report cycle that starts on Monday

If your business week runs Monday to Sunday instead of Sunday to Saturday, set return_type to 2 so every week boundary lines up correctly.

=WEEKNUM(A2, 2)   // week starts Monday instead of the Sunday default

Handling Errors

WEEKNUM throws #VALUE! when it can't interpret serial_number as a date, and #NUM! when return_type isn't one of the accepted values.

Common causes:

  • A date typed as text in a format Excel doesn't recognize for your region
  • return_type set to a number outside the valid list (1, 2, 11 through 17, or 21)
  • A text string with no date-like structure passed as serial_number

A genuinely blank cell doesn't cause either error. Excel treats it as 0, which resolves to a real (if meaningless) date near the start of Excel's date system, and WEEKNUM returns a plausible-looking week number for it instead of failing. That's arguably worse than an error in a report you're auditing, since a blank source cell produces a number that looks legitimate at a glance instead of flagging itself.

=IFERROR(WEEKNUM(A2), "Check date format")
=IFERROR(WEEKNUM(A2, C2), "Invalid week type")

If WEEKNUM is returning #NUM! on a formula that used to work, check whether someone changed the return_type cell to a value like 20 or 3. Only 1, 2, 11 to 17, and 21 are valid, and there's no autocomplete warning when someone types the wrong one.

Notes & Gotchas

Why does WEEKNUM return a different number than the calendar I'm looking at?

Most printed and online calendars use ISO week numbering, where week 1 requires the year's first Thursday and weeks start Monday. WEEKNUM defaults to a Sunday-start system where week 1 is just whichever week contains January 1. Set return_type to 21, or switch to ISOWEEKNUM, if you need the numbers to match a standard calendar.

What's the difference between WEEKNUM and ISOWEEKNUM?

ISOWEEKNUM always follows the ISO 8601 standard and takes no second argument. WEEKNUM takes an optional return_type and can mimic ISO numbering with type 21, but only if you remember to set it. If your team works internationally or reports against ISO week numbers, ISOWEEKNUM is the safer, simpler choice since there's no argument to get wrong.

Does WEEKNUM work across year boundaries?

Yes, but each date is evaluated against its own calendar year independently. A date of December 30, 2026 returns week 1 under the default system, since it falls in the week containing the following January 1, while ISOWEEKNUM assigns that same date to week 53 of 2026 instead. If you're summarizing data that spans a year end, pair WEEKNUM with YEAR in the same helper column so weeks from different years don't get merged accidentally.

What happens if serial_number is a date stored as text?

Excel tries to convert it automatically, and often succeeds if the text matches your system's regional date format. It fails silently in the sense that you get a #VALUE! error rather than a wrong week number, which is at least easy to spot. Convert text dates with DATEVALUE first if you're pulling dates from an import or a CSV file.

Why is my week 1 mostly made up of days from last year?

That's expected behavior under the default system, not a bug. Week 1 is defined as the week containing January 1, and if January 1 falls late in the week, most of that week's days belong to December of the prior year. This is one of the biggest sources of confusion when WEEKNUM output doesn't match what a manager expects from a report.

Related Functions

FunctionUse this when...
ISOWEEKNUMYou need ISO 8601 week numbers without remembering to set a return type.
WEEKDAYYou need the day of the week for a date, not which week of the year it falls in.
DATEYou need to build a date from separate year, month, and day values before feeding it into WEEKNUM.
NETWORKDAYSYou need to count working days between two dates instead of tagging a week number.