Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Using the WEEKNUM Function.

Using the WEEKNUM Function

Written by Allen Wyatt (last updated July 10, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003


One of the functions provided in the Analysis ToolPak is WEEKNUM. This function is used, oddly enough, to return the week number represented by a particular date. You use the function in this way:

=WEEKNUM(A5,1)

In this instance, A5 contains a date serial number, and the value 1 indicates that WEEKNUM should assume that all weeks start on a Sunday. If you prefer your weeks to begin on Mondays, then you can use the value 2 instead.

You should realize that WEEKNUM always considers the first day of any given year to be in the first week of the year. Thus, it is possible for the above formula to return up to 54 weeks in a year. How can this be? Let's use the year 2011 as an example. In 2011 January 1 falls on a Saturday. As far as WEEKNUM is concerned, this is in the first week of the year. Now, January 2 for that year falls on a Sunday. Since WEEKNUM believes that every Sunday starts a new week, the second day of the week is considered in the second week of the year.

This is fine, until you get to the end of the year. The fifty-second week of 2011 ends (according to WEEKNUM) on December 24, and the fifty-third week begins on December 25 (a Sunday).

An even more interesting scenario is when the year begins on a Saturday and the year is a leap year. This happened in the year 2000. In that instance, the fifty-third week began on December 24, and the fifty-fourth week began on December 31.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2326) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Using the WEEKNUM Function.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Cannot Double-Click to Open a Workbook

When you double-click on a workbook in Windows, the Excel program should be started and the workbook loaded. When this ...

Discover More

Missing PivotTable Data

Wonder what happened to the data behind a PivotTable? It could be in a number of places, and tracking it down could be a ...

Discover More

Changing the Height of Worksheet Tabs

Do you need your worksheet tabs to be taller than what they are? You can't make the adjustment in Excel, but you can make ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Counting Displayed Cells

When you filter data, Excel displays only a portion of what is really in a worksheet. If you want to count the number of ...

Discover More

Numbers in Base 12

Different professions use numbers in entirely unique ways. You may need to come up with a number that represents the ...

Discover More

Functions Within Functions

Functions are the heart of Excel's power. The program allows you to compound that power by handily putting one function ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one less than 9?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.