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 a Date Five Days before the First Business Day.

# Calculating a Date Five Days before the First Business Day

by Allen Wyatt
(last updated May 10, 2017)

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 September 26, 2012, then the first business day of the month would be September 3 and five days before that would be August 29.

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 two functions used so far (WORKDAY and EOMONTH) are both part of the Analysis ToolPak, which must be installed and enabled on your system in order for the functions to work. (How you enable the ToolPak is covered in other issues of ExcelTips.)

If you don't want to use the Analysis ToolPak for some reason, you can use a different formulaic approach, such as the following:

```=A1-DAY(A1)+1+(WEEKDAY(A1-DAY(A1))=7)+2*(WEEKDAY(A1-DAY(A1))=6)-5
```

The formula calculates the first day of the month and then adds appropriate values based on whether the first day of the month is a Saturday or Sunday. Then, five days are subtracted from the result.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12178) 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 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

Saving Form Data for a Database

Use Word to create a form, and you can easily collect standardized data from a large number of users. When it comes time ...

Discover More

Specifying Location for a Message Box

When writing macros, you may want to position a message box at a specific location on the screen. This can't be done in ...

Discover More

Inserting a Cross-Reference to Text

Cross-referencing is a great feature of Word that allows you to add references to text in various places of your ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

Calculating an Age On a Given Date

Start putting dates in a worksheet (especially birthdates), and sooner or later you will need to calculate an age based ...

Discover More

Calculating Months of Tenure

Need to know the number of months between two dates? It's easy to figure out if you use the DATEDIF function.

Discover More

Displaying a Number as Years and Months

How do you display a number of years, such as 3.67 years, as a number of years and months? It's simple to do with a ...

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 eight minus 3?

2014-03-04 11:50:20

sue watson

I would like to know how to calculate the end date of a course. I know the start date and the number of days in the course. For example

IF start date = 1/2/2014
Number of days = 84

How do I calculate the end date in excel 7 formula?

In addition, students must spend 84 days in the course. However, some students will start later, have the same time off but MUST spend 84 days in the course. What is the formula in Excel 7 given the following:

IF start date = 2/27/2014
IF time off = 3/29/2014 TO 4/4/2014
Number of days = 84 days (plus 6 days for time off)

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