How to use the WORKDAY function
What is the WORKDAY function?
The WORKDAY function returns a date based on a start date and a given number of working days (nonweekend and nonholidays).
Table of Contents
1. Introduction
What is a workday?
A weekday that is not a weekend day or holiday. Typically Monday through Friday excluding any holiday dates.
Use the WEEKDAY function to determine if a date is a workday or a weekend day.
What is a holiday?
A day on which regular activities and work is suspended due to a cultural, religious or legal custom. Varies by country and region.
What is an Excel date?
An Excel date is a serial number that Excel recognizes and can be filtered, sorted and used in other date calculations.
Excel dates are actually serial numbers formatted as dates, 1/1/1900 is 1 and 2/2/2018 is 43133. There are 43132 days between 2/2/2018 and 1/1/1900.
You can try this yourself, type 10000 in a cell, press CTRL + 1 and change the cell's formatting to date, press with left mouse button on OK. The cell now shows 5/18/1927.
2. Syntax
WORKDAY(start_date, days, [holidays])
start_date | Required. |
days | Required. Positive integer returns a date after the start_date (future) and negative integer returns a date before the start_date. |
[holidays] | Optional. A list of holiday dates. |
3. Example 1
This example demonstrates how to use the WORKDAY function to calculate a future date with the condition of being a workday excluding weekend days and holidays.
The start date is shown in cell C3 in the image above. The number of working days days is 12 and the function returns 1/18/2028. The formula in cell B8 is shown below, note that no holidays has been specified.
Formula in cell B8:
The image below shows the start date and the weekdays. The count is displayed (row 5) below dates that are workdays.
Note that there are no numbers below weekend days because they are not workdays. Counting 12 days after the start date and we get 1/18/2028.
4. Example 2
This example demonstrates the WORKDAY function with a negative day argument which means it calculates a workday before the start date instead of after the start date.
The start date is shown in cell C3 in the image above. The number of working days days is -12 (negative number meaning counting backwards in time) and the function returns 12/16/2027. The formula in cell B8 is shown below, note that holiday 12/25/2027 has been specified.
Formula in cell B9:
This example also shows no numbers below weekend days because they are not workdays, this applies to 12/25/2027 as well because it is specified as a holiday. Counting 12 days before the start date and we get 12/16/2027.
5. Example 3
If an employee's last day of work is June 15, 2025, and they are entitled to 10 working days of severance pay, on what date will their last day of severance pay be?
What we know:
- start_date = 6/15/2025 (This date is entered in cell C19)
- days = 10 (This number is specified in cell C20)
Formula in cell B25:
The formula in cell B25 returns 6/27/2025 which represents the last day of severance pay. The chart displays a period from June 15 to June 27, 2025. It's a column chart where each bar represents a day, and the height of each bar is 1 unit. The columns have data labels counting from 1 to 10 based on workday or weekend. The days are labeled with both the day of the week and the date.
The chart demonstrates the use of Excel's WORKDAY function which calculates a future date based on a start date, number of working days, and optionally, a list of holidays to exclude.
6. Example 4
A construction project is scheduled to start on May 1, 2025, and the estimated duration is 45 working days. What is the expected completion date for the project?
What we know:
- start_date = 5/1/2025 (This date is entered in cell C19)
- days = 15 (This number is specified in cell C20)
Formula in cell B25:
The formula in cell B25 returns 5/22/2025 which represents the completion date for the project. The chart displays a period from May 1 to May 22, 2025. It's a column chart where each bar represents a day, and the height of each bar is 1 unit. The columns have data labels counting from 1 to 15 based on workday or weekend. The days are labeled with both the day of the week and the date.
The chart demonstrates the use of Excel's WORKDAY function which calculates a future date based on a start date, number of working days, and optionally, a list of holidays to exclude.
7. Example 5
A construction project is scheduled to start on August 3, 2026,
Planning: 4 working days
Design: 12 working days
Procurement: 15 working days
Construction: 45 working days
Testing 6 working days
Handover: 3 working days
What is the expected completion date for the milestones and for the entire project? Assume one milestone must end until the next milestone starts.
Formula in cell E5:
The formula in cell E5 calculates all the milestone dates based on the specified workday values in C5:C10 and the start date in C4. It returns the following array: {"Fri, Aug 7, 2026";"Tue, Aug 25, 2026";"Tue, Sep 15, 2026";"Tue, Nov 17, 2026";"Wed, Nov 25, 2026";"Mon, Nov 30, 2026"}
These dates correspond to the milestones specified in cells B5:B10, for example, the start date is 8/3/2026 and the planning takes 4 workdays which results in 8/7/2026. The SCAN function uses an accumulator value (a) that adds the number of workdays row by row.
Argument | Value | Milestone dates: | |
start_date | 8/3/2026 | ||
Planning: | 4 | Fri, Aug 7, 2026 | |
Design: | 12 | Tue, Aug 25, 2026 | |
Procurement: | 15 | Tue, Sep 15, 2026 | |
Construction: | 45 | Tue, Nov 17, 2026 | |
Testing: | 6 | Wed, Nov 25, 2026 | |
Handover: | 3 | Mon, Nov 30, 2026 |
The formula in cell E5 performs the following steps:
- C4: This is the starting date for the scan operation.
- C5:C10: This is the range of cells that will be scanned.
- LAMBDA(a, b, WORKDAY(a, b)): This is a LAMBDA function that will be applied to each pair of values (a, b) from the scan operation. a is an accumulator variable that changes as the calculation proceeds through b (C5:C10)
In other words, the SCAN function applies the provided lambda function a starting date and an array containing the number of days for each milestone in the specified range C5:C10, using the previous result as the first argument (a) and the current value from the range as the second argument (b).
The WORKDAY(a, b) function calculates a date based on the number of working days specified in cell b. The WORKDAY function takes two arguments: the start date and the number of working days to add or subtract. Variable a changes to the last calculated date, Excel handles dates a integer which makes this calculation possible.
In summary, the formula is scanning through the range C5:C10, using the value in C4 as the starting date, and calculating each milestone date specified in each cell in the range C5:C10 based on the previous milestone date and number of working days to the next milestone date.
The completion date for the construction project is calculated in cell B14:
This formula returns 11/30/2026 which is the same value as in the "handover" date in cell E10.
8. The function not working
The WORKDAY function returns
- #VALUE! error value if start_date or [holidays] are not a valid date.
- #NUM error if start_date plus days argument returns an invalid date.
(Excel can't handle dates before 1/1/1900.)
Use the DATE function to create valid Excel dates.
Example:
8.1 Troubleshooting the error value
When you encounter an error value in a cell a warning symbol appears, displayed in the image above. Press with mouse on it to see a pop-up menu that lets you get more information about the error.
- The first line describes the error if you press with left mouse button on it.
- The second line opens a pane that explains the error in greater detail.
- The third line takes you to the "Evaluate Formula" tool, a dialog box appears allowing you to examine the formula in greater detail.
- This line lets you ignore the error value meaning the warning icon disappears, however, the error is still in the cell.
- The fifth line lets you edit the formula in the Formula bar.
- The sixth line opens the Excel settings so you can adjust the Error Checking Options.
Here are a few of the most common Excel errors you may encounter.
#NULL error - This error occurs most often if you by mistake use a space character in a formula where it shouldn't be. Excel interprets a space character as an intersection operator. If the ranges don't intersect an #NULL error is returned. The #NULL! error occurs when a formula attempts to calculate the intersection of two ranges that do not actually intersect. This can happen when the wrong range operator is used in the formula, or when the intersection operator (represented by a space character) is used between two ranges that do not overlap. To fix this error double check that the ranges referenced in the formula that use the intersection operator actually have cells in common.
#SPILL error - The #SPILL! error occurs only in version Excel 365 and is caused by a dynamic array being to large, meaning there are cells below and/or to the right that are not empty. This prevents the dynamic array formula expanding into new empty cells.
#DIV/0 error - This error happens if you try to divide a number by 0 (zero) or a value that equates to zero which is not possible mathematically.
#VALUE error - The #VALUE error occurs when a formula has a value that is of the wrong data type. Such as text where a number is expected or when dates are evaluated as text.
#REF error - The #REF error happens when a cell reference is invalid. This can happen if a cell is deleted that is referenced by a formula.
#NAME error - The #NAME error happens if you misspelled a function or a named range.
#NUM error - The #NUM error shows up when you try to use invalid numeric values in formulas, like square root of a negative number.
#N/A error - The #N/A error happens when a value is not available for a formula or found in a given cell range, for example in the VLOOKUP or MATCH functions.
#GETTING_DATA error - The #GETTING_DATA error shows while external sources are loading, this can indicate a delay in fetching the data or that the external source is unavailable right now.
8.2 The formula returns an unexpected value
To understand why a formula returns an unexpected value we need to examine the calculations steps in detail. Luckily, Excel has a tool that is really handy in these situations. Here is how to troubleshoot a formula:
- Select the cell containing the formula you want to examine in detail.
- Go to tab “Formulas” on the ribbon.
- Press with left mouse button on "Evaluate Formula" button. A dialog box appears.
The formula appears in a white field inside the dialog box. Underlined expressions are calculations being processed in the next step. The italicized expression is the most recent result. The buttons at the bottom of the dialog box allows you to evaluate the formula in smaller calculations which you control. - Press with left mouse button on the "Evaluate" button located at the bottom of the dialog box to process the underlined expression.
- Repeat pressing the "Evaluate" button until you have seen all calculations step by step. This allows you to examine the formula in greater detail and hopefully find the culprit.
- Press "Close" button to dismiss the dialog box.
There is also another way to debug formulas using the function key F9. F9 is especially useful if you have a feeling that a specific part of the formula is the issue, this makes it faster than the "Evaluate Formula" tool since you don't need to go through all calculations to find the issue..
- Enter Edit mode: Double-press with left mouse button on the cell or press F2 to enter Edit mode for the formula.
- Select part of the formula: Highlight the specific part of the formula you want to evaluate. You can select and evaluate any part of the formula that could work as a standalone formula.
- Press F9: This will calculate and display the result of just that selected portion.
- Evaluate step-by-step: You can select and evaluate different parts of the formula to see intermediate results.
- Check for errors: This allows you to pinpoint which part of a complex formula may be causing an error.
The image above shows cell reference C3 converted to hard-coded value using the F9 key. The WORKDAY function requires a valid Excel date which is not the case in this example. We have found what is wrong with the formula.
Tips!
- View actual values: Selecting a cell reference and pressing F9 will show the actual values in those cells.
- Exit safely: Press Esc to exit Edit mode without changing the formula. Don't press Enter, as that would replace the formula part with the calculated value.
- Full recalculation: Pressing F9 outside of Edit mode will recalculate all formulas in the workbook.
Remember to be careful not to accidentally overwrite parts of your formula when using F9. Always exit with Esc rather than Enter to preserve the original formula. However, if you make a mistake overwriting the formula it is not the end of the world. You can “undo” the action by pressing keyboard shortcut keys CTRL + z or pressing the “Undo” button
8.3 Other errors
Floating-point arithmetic may give inaccurate results in Excel - Article
Floating-point errors are usually very small, often beyond the 15th decimal place, and in most cases don't affect calculations significantly.
'WORKDAY' function examples
The image above shows the performance across industry groups for different date ranges, conditional formatting makes the table much easier […]
Functions in 'Date and Time' category
The WORKDAY function function is one of 22 functions in the 'Date and Time' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form