--- title: "Calculate Project Duration" slug: "calculate-project-duration" updated: 2025-06-11T20:58:44Z published: 2025-06-11T20:58:44Z canonical: "documentation.encodify.com/calculate-project-duration" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.encodify.com/llms.txt > Use this file to discover all available pages before exploring further. # Calculate Project Duration ## Date Calculations --- Once the Event App has been configured, you can use specific calculations to determine duration taking into consideration non-working days. The below table provides an overview of the 3 calculation formulas available: | durationWorkingDays(, , , ) | Integer | Duration expressed in number of days excluding configured non-working days with possibility to define if start/end date or both should be included in duration calculation. For the formula to work, Events app must be configured for the site. Follow [this](/v1/docs/events) link to access configuration guide. **Works only with Date and date-time fields.* *In case of date-time fields, only date is used in calculation, hours and minutes are ignored. Week-year, month-year fields may return inconsistent results.* | | --- | --- | --- | | addWorkingDays(, , ) | Date | Function adds specifed number of days excluding non-working days, with parameter to define if start date should be included in calculation. For the formula to work, Events app must be configured for the site. Follow [this](/v1/docs/events) link to access configuration guide. **Works only with Date and date-time fields.* *In case of date-time fields, only date is used in calculation, hours and minutes are ignored. Week-year, month-year fields may return inconsistent results.* | | subtractWorkingDays(, , ) | Date | Function subtracts specifed number of days excluding non-working days, with parameter to define if start date should be included in calculation. For the formula to work, Events app must be configured for the site. Follow [this](/v1/docs/events) link to access configuration guide. **Works only with Date and date-time fields.* *In case of date-time fields, only date is used in calculation, hours and minutes are ignored. Week-year, month-year fields may return inconsistent results.* |

Examples:

Duration Calculation

Formula: durationDays(${Start date}, ${End date}, true, true)
Project start date: 01/01/2021
Project end date: 02/01/2021
Duration will be equal to 2.

Formula: durationDays(${Start date}, ${End date}, true, false)
Project start date: 01/01/2021
Project end date: 02/01/2021
Duration will be equal to 1.


Formula: durationDays(${Start date}, ${End date}, false, true)
Project start date: 01/01/2021
Project end date: 02/01/2021
Duration will be equal to 1.


Formula:durationDays(${Start date}, ${End date}, false, false) Project start date: 01/01/2021
Project end date: 02/01/2021 Duration will be equal to 0.

Adding/Subtracting days respecting non-working dates

Formula: addWorkingDays(${Start date}, ${Integer}, true)
Project start date: 31/12/2020
Days to add: 3


Event start date: 01/01/2021

Event end date: 02/01/2021


Resulting calculated date is 04/01/2021


Formula: subtractWorkingDays(${Start date}, ${Integer}, true)
Project start date: 31/12/2020
Days to subtract: 3


Event start date: 29/12/2020

Event end date: 30/12/2020


Resulting calculated date is 27/12/2020

Formula: addWorkingDays(${Start date}, ${Integer}, false)
Project start date: 31/12/2020
Days to add: 3


Event start date: 01/01/2021

Event end date: 02/01/2021


Resulting calculated date is 05/01/2021


Formula: subtractWorkingDays(${Start date}, ${Integer}, false)
Project start date: 31/12/2020
Days to subtract: 3


Event start date: 29/12/2020

Event end date: 30/12/2020


Resulting calculated date is 26/12/2020

> [!WARNING] > Note! > > When calculating duration or adding/subtracting days respecting non-working days, event duration is always calculated including start and end date. > [!NOTE] > Example: > > Event start date: 01/01/2021 Event end date: 01/02/2021 > > Event duration (total number of days) is 2. **Known Limitations:** - Long numbers (more than 6 digits) cannot be used as increments in date calculation formulas; - Event is ignorred if its Start date > End date.