FormulaCraft

How to get the week number from a date in Excel and Google Sheets

Excel & Google Sheets
=WEEKNUM(A2,2)

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

Step by step

  1. 1Enter your date in A2.
  2. 2Enter =WEEKNUM(A2,2) in a result cell.
  3. 3The second argument sets the first day of the week: 1=Sunday, 2=Monday (ISO standard).
  4. 4For strict ISO 8601 week numbers use =ISOWEEKNUM(A2) in Excel 2013+ or Google Sheets.
  5. 5WEEKNUM returns 1-53; results may differ slightly from ISO by a week at year boundaries.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

What is the difference between WEEKNUM and ISOWEEKNUM?

WEEKNUM starts counting with the week containing January 1. ISOWEEKNUM follows ISO 8601, where week 1 is the week containing the first Thursday of the year. Results differ at year-start and year-end.

How do I group data by week in a pivot table?

Add a helper column with =WEEKNUM(A2) or =ISOWEEKNUM(A2), then use that column as a row field in your pivot table to group records by week number.

Formulas used

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

Last reviewed: