Table of Contents
AddWorkdays(start_date, days, [exclude], [include], [weekend_start])
Category: Date and Time function
Description
This function adds days considered workdays to start_date and returns the date reached. If days is negative, the workdays are counted backwards. By default, workdays are all days except Saturday and Sunday.
Arguments
| Argument | Type | Description |
|---|---|---|
| start_date | Date or Number (date serial) | An expression representing the date to count workdays from. The value must not contain a time part. |
| days | Number | The number of workdays to add to start_date, or to subtract if negative. Must be a whole number, and less than 36500. |
| exclude | Text | (Optional) Dates that are not workdays, such as public holidays. This argument should appear as a list of comma-separated dates in text format, enclosed in quotes (i.e., "2020-11-26, 2020-04-24"). |
| include | Text | (Optional) Dates that are workdays even when they fall on a weekend. This argument should appear as a list of comma-separated dates in text format, enclosed in quotes (i.e., "2020-08-15, 2020-03-22"). |
| weekend_start | Number | (Optional) The day of the week the two weekend days start on, from 1 (Sunday) to 7 (Saturday), the same numbering as Weekday(). The default is 7, i.e. the weekend is Saturday and Sunday. |
Return value type: Number (date serial value).
Remarks
start_date itself is never counted, whether it is a workday or not. Counting starts from the next workday in the direction given by the sign of days. If days is 0, start_date is returned unchanged, even when it falls on a weekend.
The start_date argument can take any value or expression that evaluates to a date serial value. Examples include:
- A date literal: #2019-12-12
- A date serial value: 43811 (the date serial for "2019-12-12")
- A date value created using any of the Date/Time functions that returns a date serial value
The exclude and include arguments need to be a date or list of dates, delimited by commas, enclosed in quotes, and appearing in yyyy-MM-dd format:
- A single date: "2024-02-20"
- List of 3 dates: "2023-04-01, 2023-07-22, 2023-10-31"
- Use empty quotes ("") in the exclude position if no dates are excluded, but there are dates to be included.
- Use empty quotes in both positions to specify weekend_start without excluding or including any dates.
- A date serial value cannot be used (i.e., "43811").
Examples
In the examples below, 2025-04-11 is a Friday, 2025-04-12 a Saturday, 2025-04-13 a Sunday and 2025-04-14 a Monday.
addworkdays(#2025-04-11, 1) //Returns 45761 (Equivalent to 2025-04-14; the weekend is skipped.)
addworkdays(#2025-04-14, -1) //Returns 45758 (Equivalent to 2025-04-11; count backwards.)
addworkdays(#2025-04-09, 5) //Returns 45763 (Equivalent to 2025-04-16; five workdays are exactly one week.)
addworkdays(#2025-04-12, 0) //Returns 45759 (Equivalent to 2025-04-12; a Saturday is returned unchanged.)
addworkdays(#2025-04-12, 1) //Returns 45761 (Equivalent to 2025-04-14; counting starts from the next workday.)
addworkdays(#2025-04-11, 1, "2025-04-14") //Returns 45762 (Equivalent to 2025-04-15; the Monday is excluded.)
addworkdays(#2025-04-11, 1, "", "2025-04-12") //Returns 45759 (Equivalent to 2025-04-12; the Saturday counts as a workday.)
addworkdays(#2025-04-12, 1, "", "", 1) //Returns 45762 (Equivalent to 2025-04-15; the weekend is Sunday and Monday, so the Saturday is a workday.)