FormulaCraft

WEEKNUM

WEEKNUM calculates which week of the year a date falls in, accepting an optional return_type argument that controls whether the week starts on Sunday (1, default) or Monday (2). It is commonly used for weekly reporting, sprint planning, and grouping data by week number.

Excel
=WEEKNUM(DATE(2024,3,15),2)
Google Sheets
=WEEKNUM(DATE(2024,3,15),2)

Verified example

Computed by a real spreadsheet engine on the sample data below.

SaleDateWeekNum
2024-01-07
2024-03-15
2024-07-22
2024-12-29

=WEEKNUM(DATE(2024,3,15),2)11

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1Place your date values in column A as proper Excel dates.
  2. 2In column B enter =WEEKNUM(A2) for Sunday-based weeks, or =WEEKNUM(A2,2) for Monday-based weeks.
  3. 3Use the resulting week numbers in a pivot table or SUMIF to aggregate data by week.

Need a version for your data?

Try: “Add a week number column to my sales data so I can group by week

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: