Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Calculating Week-Ending Dates.

# Calculating Week-Ending Dates

by Allen Wyatt
(last updated May 8, 2018)

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. (Remember: This is a year in A1 not a date.) 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 (10481) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel 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

Changing Excel's Background Color

Excel doesn't provide a built-in means to change the standard background color of a worksheet. There are a few different ...

Discover More

Replacing a Colon in a Sequence

Sometimes you'll run across the need to replace a very specific sequence of characters in your document. It is for these ...

Discover More

Strange Formula Conversions

When you are getting the hang of how to put together formulas in Excel, you might run into a situation where you open a ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

##### More ExcelTips (ribbon)

Determining If a Date is between Other Dates

Need to figure out if one date is between two other dates? There are a wide variety of formulaic approaches you could use ...

Discover More

Month for the Nth Sunday

Doing math with dates is quite easy in Excel. As this tip illustrates, this fact makes it easy to figure out the Nth ...

Discover More

Deciphering a Coded Date

It is no secret that Excel allows you to work with dates in your worksheets. Getting your information into a format that ...

Discover More
##### Subscribe

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

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}] 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 four more than 7?

2019-12-15 23:14:42

Chris

The original formlas based on WEEKDAY, and those with Floor/Ceiling listed later in the comments below arent working for me in office 2016. The =WORKDAY.INTL(B2,1,"1111110") did work however.

2018-05-11 17:01:36

Ricardo Ribas

There is another formula that calculates the week ending date and may simplify things a little.

In A1 write the complete starting date (1-1-2018). In A2 write the following formula: =WORKDAY.INTL(A1,1,"1111110") for weeks ending in Sunday.
If you copy the formula down column A, you get all the Sundays.

The Workday.Intl function, which appeared in Excel 2010 lets you calculate a date after so many working days, but instead of having a fixed weekend (Saturday and Sunday) as the Workday function does, it lets you specify which are the workdays of the week.
In the example above, the string "1111110" means that you only work on Sundays. The 1s in the string specify a nonworking day, and the 0s a working day. The first number is for Monday.
So if your week ends on a Friday, the string would be "1111011"

2018-05-10 14:25:46

Willy Vanhaelen

Here is an even shorter formula for Sundays: =FLOOR(DATE(A1,1,6),7)+1

2018-05-08 12:03:00

Willy Vanhaelen

Here are 3 much shorter formulas:

For Fridays: =CEILING(DATE(A1,1,2),7)-1
For Saturdays: =CEILING(DATE(A1,1,1),7)
For Sundays: =CEILING(DATE(A1-1,12,31),7)+1

As for the formula in A4 you can better simply use =A3+7 and copy it down as far as needed.

2017-01-07 05:53:31

Steve J

@ Baruc
Do you have a year such as 2017 in cell A1?
Steve

2017-01-06 08:40:17

BARUC

When I use the formula
=DATE(A1,1,1)+7-(WEEKDAY(DATE(A1,1,1)+1))
to get a date for Friday
I get an error with the formula
#NUM!
what am I doing wrong?

##### This Site

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