Please Note: This article is written for users of the following Microsoft Excel versions: 2007 and 2010. 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: Date for Next Wednesday.
by Allen Wyatt
(last updated November 9, 2013)
Sam has a date in cell A1 and he would like to calculate the date of the following Wednesday in cell B1. He wonders what formula he should use for the calculation.
There are actually many formulas you can use, and the one you pick is pretty much up to you. Here is a good representative sampling of formulas you can use:
=IF(WEEKDAY(A1)<=4,A1+4-WEEKDAY(A1),A1+11-WEEKDAY(A1)) =A1+WEEKDAY(A1, 1)+CHOOSE(WEEKDAY(A1, 1), 2, 0, -2, -4, 1, -1, -3) =A1+CHOOSE(WEEKDAY(A1),3,2,1,0,6,5,4) =A1-MOD(WEEKDAY(A1)-5,7)+6 =A1+MOD(4-WEEKDAY(A1),7)
These formulas return a date that represents next Wednesday, provided that the date in cell A1 isn't a Wednesday to begin with. For instance, if the date in A1 is 5/26/10 (a Wednesday), then each of these will return 5/26/10. However, if the date is 5/27/10 then the formula returns 6/2/10.
If you want a formula that will return the next Wednesday even when the starting date is a Wednesday, then you should rely on a different formula. Choose from one of these:
=A1+IF(WEEKDAY(A1,1)=4,7,IF(WEEKDAY(A1,1)<4,4-WEEKDAY(A1,1),11-WEEKDAY(A1,1))) =IF(WEEKDAY(A1)<4,A1+4-WEEKDAY(A1),A1+11-WEEKDAY(A1)) =IF(WEEKDAY(A1)=4,A1+7,A1+MOD(4-WEEKDAY(A1),7)) =A1+MOD(4-WEEKDAY(A1),7)+7*(0=MOD(4-WEEKDAY(A1),7)) =A1+7-MOD(4+WEEKDAY(A1,2),7) =A1+4-WEEKDAY(A1)+IF(WEEKDAY(A1)<4,0,7) =A1+CHOOSE(WEEKDAY(A1),3,2,1,7,6,5,4) =A1+(7-MOD(WEEKDAY(A1,3)-2,7)) =A1+4-WEEKDAY(A1)+7*(WEEKDAY(A1)>=4) =A1-MOD(WEEKDAY(A1)-4,7)+7 =A1+4+((WEEKDAY(A1)>=4)*7)-WEEKDAY(A1) =A1+MOD(10-WEEKDAY(A1),7)+1 =A1+IF(WEEKDAY(A1) < 4,4,11)-WEEKDAY(A1) =CEILING(A1-4,7)+4 =A1+6-MOD(A1+2,7)
It should be noted that the last two of these formulas works just fine on the PC but won't work as expected on the Mac. This is because the basis date used for date serial numbers is different on the Mac than it is on the PC, and thus the computations—which operate on the underlying serial numbers for the dates—return different values on each platform.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8625) applies to Microsoft Excel 2007 and 2010. You can find a version of this tip for the older menu interface of Excel here: Date for Next Wednesday.
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!
When you load data into Excel that was created in other programs, the formatting used for some types of data (such as dates) ...Discover More
Excel includes a large number of functions that can be used in evaluating the data in a worksheet. In this tip you learn ...Discover More
Given a starting date and an ending date, you may want to generate the names of all the months between those two dates. This ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.