The addworkdays function allows you to add a certain number of work days to the specified date.
This is how it looks:
=addworkdays([date], [number of work days])
In the [date] section, you can use variables, template parameters, or entity fields. Also, you can enter any date manually or set the current time and date using {=System:Now}.
In the [number of work days] section, use any integer from 1 to 250. Thus, you can add at least 1 work day to the specified date, or 250 work days at the most. For example:
=addworkdays({=Document:DATE_CREATE}, 1): The resulting date will be 1 work day later than the document creation date.
=addworkdays('2/2/2024', 1): The resulting date will be 2/5/2024 (Monday) since 2/2/2024 is Friday and Saturday and Sunday are specified as weekends in settings.
To edit weekends and holidays, go to Settings and open the Business hours tab. All other days will be considered working days.
Learn how to insert values using special macros
Use case
The function is commonly used to automatically calculate the deadline for a task based on its creation date. Let's consider the following example and create a task that needs to be done in 10 working days.
- Add the Create task activity to your workflow.
-
Insert =addworkdays({=System:Now}, 10) in the Deadline field.
-
Run your workflow to create a task. The deadline will be set 10 work days later than the creation date.
{{=addworkdays ({=System:Now}, 10)}}