WEEKNUM function

This article describes the formula syntax and usage of the WEEKNUM function (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) in Microsoft Excel.

Description

Returns the week number of a specific date. For example, the week containing January 1 is the first week of the year, and is numbered week 1.

There are two systems used for this function:

  • System 1    The week containing January 1 is the first week of the year, and is numbered week 1.
  • System 2    The week containing the first Thursday of the year is the first week of the year, and is numbered as week 1. This system is the methodology specified in ISO 8601, which is commonly known as the European week numbering system.

Syntax

WEEKNUM(serial_number,[return_type])

The WEEKNUM function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

  • Serial_number     Required. A date within the week. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text.
  • Return_type     Optional. A number that determines on which day the week begins. The default is 1.
Return_type Week begins on System
1 or omitted Sunday 1
2 Monday 1
11 Monday 1
12 Tuesday 1
13 Wednesday 1
14 Thursday 1
15 Friday 1
16 Saturday 1
17 Sunday 1
21 Monday 2

Remark

  • Microsoft Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.
  • If serial_number is out of range for the current date base value, a #NUM! error is returned.
  • If return_type is out of the range specified in the table above, a #NUM! error is returned.

Example 1

The example may be easier to understand if you copy it to a blank worksheet.

ShowHow do I copy an example?

  1. Select the example in this article. If you are copying the example in Excel Online, copy and paste one cell at a time.
    Important: Do not select the row or column headers.

Selecting an example from Help

Selecting an example from Help

  1. Press CTRL+C.
  2. Create a blank workbook or worksheet.
  3. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Online, repeat copying and pasting for each cell in the example.
    Important: For the example to work properly, you must paste it into cell A1 of the worksheet.
  4. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

After you copy the example to a blank worksheet, you can adapt it to suit your needs.

 
1
2
3

4

5
A B
Data
March 9, 2008
Formula Description (Result)
=WEEKNUM(A2,1) Number of the week in the year, with a week beginning on Sunday (11)
=WEEKNUM(A2,2) Number of the week in the year, with a week beginning on Monday (10)


 Notes 

  • March 9, 2008 is a Sunday.
  • In Excel Web App, to view the result in its proper format, select the cell, and then on the Home tab, in the Number group, click the arrow next to Number Format, and click General.

Example 2

The example may be easier to understand if you copy it to a blank worksheet.

ShowHow do I copy an example?

  1. Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers.

Selecting an example from Help

Selecting an example from Help

  1. Press CTRL+C.
  2. Create a blank workbook or worksheet.
  3. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example.

Important For the example to work properly, you must paste it into cell A1 of the worksheet.

  1. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

After you copy the example to a blank worksheet, you can adapt it to suit your needs.

Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a

 
1

2

3

4

5

6

7
A B
Formula Description (Result)
=WEEKNUM(DATE(2006,1,1)) Number of the week in the year, with a week beginning on Sunday (1)
=WEEKNUM(DATE(2006,1,1),1) Number of the week in the year, with a week beginning on Sunday (1)
=WEEKNUM(DATE(2006,1,1),17) Number of the week in the year, with a week beginning on Sunday (1)
=WEEKNUM(DATE(2006,2,1),1) Number of the week in the year, with a week beginning on Sunday (5)
=WEEKNUM(DATE(2006,2,1),2) Number of the week in the year, with a week beginning on Monday (6)
=WEEKNUM(DATE(2006,2,1),11) Number of the week in the year, with a week beginning on Monday (6)

 Note    In Excel Web App, to view the result in its proper format, select the cell, and then on the Home tab, in the Number group, click the arrow next to Number Format, and click General.

 
 
Applies to:
Excel 2010, Excel Web App, SharePoint Online for enterprises, SharePoint Online for professionals and small businesses