- Computers & Software»
- Computer Software»
- Office Software Suites»
- Microsoft Office
Handling Working Days in Excel
When working with dates in Excel at some point you will find it necessary to handle working days only. Excel provides a few useful functions to perform date calculations such as to find the number of working days between 2 dates, or the next working day after a specified date.
For the purposes of this hub we will be using a spreadsheet for a dog crate supplies company. They input the dates of orders placed and want to calculate the expected delivery date for customers (within the next 5 working days), the actual delivery date and then the number of days between the order date and delivery date highlighting any deliveries that exceed the 5 working day guarantee.
Using the WORKDAY function
Ok, firstly we will calculate the expected delivery date. To do this we will use the WORKDAY function.
The WORKDAY function is used to return the date a specified number of working days before or after a specified date. The syntax for the function is;
=WORKDAY(start_date, days, [holidays])
Start_date – The start date for the spreadsheet below is the order date
Days – The number of days before or after the start date. In the example below 5 is entered. This calculates 5 working days after the start date. To enter a number of days before the start date you would entered the number as a negative
Holidays – This is optional and not used on the dog crate supplies sheet. Holidays would be a range of cells containing dates of non-working days you want the function to exclude
Using the NETWORKDAYS function
Next is to calculate the number of working days between the order date and the delivery date. This requires the use of the NETWORKDAYS function. The syntax for the function is;
=NETWORKDAYS(start_date, end_date, [holidays])
Start_date – The start date on the sheet is the order date
End_date – The end date on the sheet is the delivery date
Holidays – A range of cells containing dates of non-working days you want the function to exclude. This argument is omitted on the spreadsheet below
Installing the Analysis ToolPak
If the WORKDAY and NETWORKDAYS functions do not work, you will need to install the Analysis ToolPak in Excel. The Analysis ToolPak is an Excel Add-In providing data analysis tools.
Click the Office Button and click Excel Options
Click Add-Ins in the list on the left
Click the Go button at the bottom of the dialogue box
Tick the box for the Analysis ToolPak
It will take a few seconds to install. Try entering the functions again and they should work as needed.
Highlighting the Overdue Deliveries
Lastly we would like to highlight the deliveries that exceeded the 5 working day guarantee so that they can be easily identified. Conditional Formatting is needed to complete this task. To highlight the deliveries:
Select the cells containing the NETWORKDAYS function
Click the Conditional Formatting button on the Home tab
Select Highlight Cell Rules and then Greater Than
Enter 5 in the first box and click the drop down list arrow and select the formatting you wish to apply in the second box