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: Calculating Week-Ending Dates.

Calculating Week-Ending Dates

Written by Allen Wyatt (last updated February 16, 2019)
This tip applies to Excel 97, 2000, 2002, and 2003


1

Do you keep track of information based on week-ending dates? Many businesses do, and therefore need a quick way to calculate the week-ending dates for the complete year. The dates could be easily calculated with a macro, but you can do it just as easily with formulas.

There are two formulas you can use in order to calculate your week-ending dates. Let's assume, for the sake of this example, that your year is stored in cell A1. You could then figure out the first Saturday of the year by using this formula in cell A3:

=DATE(A1,1,1)+7-WEEKDAY(DATE(A1,1,1))

This works because the WEEKDAY function returns a value of 1 (Sunday) through 7 (Saturday) for any date. If you subtract that value from 7, then you have a value of 6 (Sunday) through 0 (Saturday). When you add that value to the DATE value for January 1 of the year, you end up with the first Saturday of the year.

If you prefer to have your weeks end on Fridays, then the formula needs to change a bit:

=DATE(A1,1,1)+7-(WEEKDAY(DATE(A1,1,1)+1))

Finally, if you prefer to have your weeks end on Sundays, then the formula needs to be like this one:

=DATE(A1,1,1)+7-WEEKDAY(DATE(A1,1,1),2)

This formula uses a parameter for the WEEKDAY function that calculates weekdays that range from 1 (Monday) through 7 (Sunday).

Once you have the first week-ending date for the year (in A3, remember?), then you can calculate the rest of the week-ending dates for the year. Place the following formula in cell A4:

=IF(YEAR(A3+7)=$A$1,A3+7,"")

This checks to see if one week past the previous date is still in the year. If it is, then the new date is returned. If it isn't, then an empty string is returned. If you copy this formula from A4 down through A55, then you will have all the desired week-ending dates for the year. With the formulas in place, simply change the year in cell A1 to see how the dates change.

The range A3:A55 provides room for 53 week-ending dates, which is possible for any given year. Because you used the IF statement in the formula in cells A4:A55, then the very last value (A55) will be blank if there were only 52 week-ending dates for the year.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2444) 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: Calculating Week-Ending Dates.

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

Quickly Displaying Formatting Specs

It's easy to apply formatting to text, but often hard (after the fact) to know exactly what was done. If you often need ...

Discover More

Finding the Size of Individual Worksheets

Your workbooks can contain many, many worksheets. Which of those worksheets are the largest, however? Here's some ideas ...

Discover More

Displaying Worksheets in a Slideshow Fashion

Want to step through the worksheets in a workbook, displaying them like a slideshow? The macros provided in this tip can ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (menu)

Forcing Dates Forward

Want to push a date to some pre-defined day of the month? Here's some ways to force the issue.

Discover More

Unique Military Date Format

Some industries (such as the military) have special formatting that they use to represent dates. Here is one such format ...

Discover More

Calculating a Date Five Days before the First Business Day

Excel allows you to perform all sorts of calculations using dates. A good example of this is using a formula to figure ...

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 6 + 5?

2022-08-25 11:59:30

Ruvimbo

Amazing thanks so much! For anyone who got a 5 digit number instead of a date on the last formula i.e. (=IF(YEAR(A3+7)=$A$1,A3+7,"")
All you have to do is right click on the cell; click on 'format cells'; under the 'Number' tab click on 'Date'; then click on 'Okay'. This should then convert the digits into a date.


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.