Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. 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 a Date Five Days before the First Business Day.

Calculating a Date Five Days before the First Business Day

Written by Allen Wyatt (last updated December 17, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


DeWayne has a date in cell A1, and it is easy to extract the month from that date. What he needs to do, however, is to calculate the date that is five calendar days before the first business day of the month. Thus, if the date in cell A1 is October 10, 2022, then the first business day of the month would be October 3 and five days before that would be September 28. (It is important to note that the five-day adjustment is based on calendar days, not on business days.)

There are many different formulas you can use to derive such a date. The shortest one that I've come across is this one:

=WORKDAY(A1-DAY(A1),1)-5

It subtracts the day of the month from the current date, which gives the last day of the previous month. Using this as a parameter for the WORKDAY function, along with a second parameter of 1, gives you the first workday (business day) of the current month. Five days is then subtracted from this date, giving the desired result.

You could also, if you prefer, use the EOMONTH function within the formula, in this manner:

=WORKDAY(EOMONTH(A1,-1),1)-5

The EOMONTH(A1,-1) portion of the formula gives the same result as A1-DAY(A1), which is the last day of the previous month.

You could also use the third parameter of the WORKDAY function to take holidays into account, if you desire. The easiest way to do this is in this manner:

=WORKDAY(A1-DAY(A1),1,MyHolidays)-5

In this usage, MyHolidays is a name you assign to a range of cells, where each cell contains the date of a holiday during the year.

It should be noted that the WORKDAY function assumes that the non-workdays are Saturday and Sunday. This might not always be the case, however. If you want the ability to specify different non-workdays, then you should investigate the WORKDAY.INTL function, which was introduced in Excel 2010. It works much the same as the WORKDAY function, except it adds a new parameter that is specified in the third position. For instance, let's say that DeWayne runs a barber shop that is closed on Sunday and Monday. (These are the non-business days for DeWayne's business.) In that case, you could calculate the date that is five days before the the first business day of the month with the following:

=WORKDAY.INTL(A1-DAY(A1),1,2,MyHolidays)-5

In this case, if the date in cell A1 is still October 10, 2022, then the first business day of the month would be October 1 (a Saturday, which is a business day for DeWayne's barber shop), and five days before that would be September 26.

Note the addition of the third parameter, in this case the value 2. This value indicates which days of the week are your non-workdays. The value can be one of the following:

Value Non-Workdays
1 Saturday/Sunday
2 Sunday/Monday
3 Monday/Tuesday
4 Tuesday/Wednesday
5 Wednesday/Thursday
6 Thursday/Friday
7 Friday/Saturday
11 Sunday
12 Monday
13 Tuesday
14 Wednesday
15 Thursday
16 Friday
17 Saturday

Other than the added third parameter, the WORKDAY.INTL function works the same as the WORKDAY function.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12179) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Calculating a Date Five Days before the First Business Day.

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

Cleaning Text

You can use the CLEAN worksheet function to remove any non-printable characters from a cell. This can come in handy when ...

Discover More

Counting Groupings Below a Threshold

When analyzing data, you may need to distill groupings from that data. This tip examines how you can use formulas and ...

Discover More

Odd Arrow Key Behavior

Press the up or down arrow keys, and you expect Excel to change which cell is selected. If this doesn't occur on your ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Using a Text Function with a Date/Time Returns an Error

If you use a text function with a date or time, you'll get an error. To understand why this occurs (and how to get around ...

Discover More

The Last Business Day

Many businesses need to know when the last business day of the month occurs. This tip discusses several ways you can ...

Discover More

Copying Dates a Year Into the Future

Need to copy a range of dates and update them to a different year? Here are a number of ways to accomplish this task with ...

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 two 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 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.

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.