Name

WEEKNUM

Synopsis

Use WEEKNUM (an Analysis ToolPak function) to determine the numeric value of the week of the year that corresponds to the specified date.

To Calculate

=WEEKNUM(Serial_Number, Return_Type)
Return_Type

This argument indicates what day you choose as the first day of the week. The value of this argument can be an integer value of 1 or 2, as described in the following list. For example, if you select Sunday as the first day of the week, use 1 as the value. If you do not provide a value for the Return_Type argument, the default value is 1.

1

This is the default value for the Return_Type argument. If you specify this value, Sunday is considered the first day of the week.

2

If you specify this value Monday is considered the first day of the week.

Example

Figure 13-13 illustrates how to use WEEKNUM to determine the numeric week value of the specified date. You will notice that the function returns a different week value for the same date when we specify a different value for the Return_Type argument. Since the date is on a Sunday when the value of Return_Type is 1, it is the first day of the twenty-second week of the year. But, when we indicate that Monday is the first day of the week by specifying a value of 2 for Return_Type, the date becomes the last day of the twenty-first week.

Use WEEKNUM to determine the week number of a specific date

Figure 13-13. Use WEEKNUM to determine the week number of a specific date

Get Excel 2000 in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.