WORKDAY
Use the WORKDAY function to return a date (or datetime) that is the indicated number of working days before or after a start date (or datetime)'. Working days exclude weekends and any dates identified as holidays.
Use
WORKDAY( start_date, days [, holidays] )
Returns a date (or datetime) that is the indicated number of working days before or after a start date (or datetime).
| Parameter | Required | Description |
|---|---|---|
| start_date | Yes | a date that represents the start date |
| days | Yes | the number of working days before or after start_date |
| holidays | No | an array of dates to exclude from the working calendar |
| Returns | Date (or Datetime) |
Examples
Automatically Calculating a Task Deadline (Variable Update)
You can use the WORKDAY function in a Variable Update formula to set a deadline that is always a fixed number of business days from the moment an approval is triggered.
- Scenario: You want a variable called
$ReviewDeadlineto be set to exactly 5 business days after the approval starts. - Formula:
WORKDAY(TODAY(), 5). - Logic:
TODAY(): A function that retrieves the current system date.5: The number of working days to add.
- Result: If today is a Friday, the function will skip Saturday and Sunday, returning the date for the following Friday (5 business days later).
Setting an Expiration Date with Holiday Exclusions (Step Property)
You can use the optional holidays parameter to ensure that activity expirations or due dates account for office closures or public holidays.
- Scenario: An "Expense Review" activity must expire exactly 10 working days after the approval was started, excluding a list of national holidays stored as a Constant.
- Formula:
WORKDAY(@prop.StartedOn, 10, #NationalHolidays). - Logic:
@prop.StartedOn: A system property representing the exact date and time the approval run began.10: The number of working days to add.#NationalHolidays: A Constant containing an array of dates to be excluded from the calculation.
- Result: The activity's Expire On property will be set to a date that accounts for both weekends and the specific holiday dates provided in the array.