If you wish to use ALICE to optimize the cost or duration of your project, the duration formula feature is a powerful tool. Unlike traditional scheduling methods where the duration of a task is a static number, you can define formulas so that ALICE will calculate task durations for you based on parameters such as quantities, production rates or crew counts. We call this making a task **Parametric.**

The benefit of making tasks parametric is that it enables automated optimization and scenario exploration (Optioneering). Users can change the parameters and ALICE will automatically propagate the changes across the entire schedule.

With planned duration formulas you can:

- Explore the impact of production rates on schedule, cost, and duration
- Explore the impact of crew, equipment or material availability on schedule, cost, and duration
- Incorporate custom properties (user defined fields) into schedule simulations

In this article, we will cover the technical details of how to create planned duration formulas in ALICE Core.

**Static and Parametric Task Durations**

Before we begin, it is important to discuss the difference between static and parametric task durations.

- Static task durations are simple numbers that represent the amount of time allocated for a task. For example, a duration of 3 hours, or 4.5 days. Most traditional planning uses static durations.
- Parametric task durations are unique to ALICE. Users can create a formula based on parameters such as number of crews, production rate, or equipment available, and ALICE will calculate the durations as part of the scheduling algorithm.
- In ALICE, users can work with static duration, parametric durations, or a combination of both

*Working with the Planned Duration Field to Input Static Task Durations*

Users can directly edit the duration field in ALICE to make changes to the static duration (for example, changing the duration from 1 to 2 hours). When a schedule is imported into ALICE Core, the existing durations will be populated in the **planned** **duration field** on the plan page.

- Note: for imported schedules with actualized tasks, there will also be data in an actual duration column for completed tasks that populates based on data in the imported schedule.

*Working with the Planned Duration Formula Field to Input Parametric Durations*

Users can make a task duration parametric by inputting their desired formula into the **planned duration formula (hours)** field on the plan page.

- Tip: If you don’t see this column on your plan page, you can left-click anywhere in the Gantt chart header row to open the menu to add columns, and select this column from the list.

When a schedule is imported from P6 or MSP, the planned duration formula column will be empty, and the value in the planned duration column will be used when generating a schedule.

Once a duration formula has been created for a task, the planned duration field for that task becomes non-editable, as it is based on the duration formula field.

If the duration formula is removed, the user can once again directly edit the duration field for that task.

Planned duration formulas can be configured for any tasks in the schedule that are not yet completed. Duration formulas cannot be input for milestones or completed tasks.

**Building a Duration Formula**

Duration formulas are created using variables and algebraic operators and input directly into the Planned Duration Formula field on the plan page. The variables must be formatted in snake case, and there is a duration formula helper tool to assist you in the formatting. Read on to learn more, or click here to view a tutorial.

*Use the Duration Formula Helper to Find Variable Names*

The duration formula helper allows users to find the names and syntax of variables for a duration formula.

On the plan page, next to the header of the duration formula column, there is a blue icon. Click this icon to open the duration formula helper.

*The blue icon will open the duration formula helper *

The helper will quickly allow you to find the available variables that can be used for building duration formulas, such as crew size, budgeted labor units, production rates or custom properties. Click the name of any variable to copy it to your clipboard. From there, you can paste the field into the planned duration field on the plan page.

In the duration formula helper, all of the variables are formatted in snake case. Snake case is a format which replaces spaces and hyphens with underscores. This format is required for compatibility with the ALICE scheduling algorithm. As long as you use the duration formula helper to pull the names of variables, you will not need to further modify the formatting.

Note: when updating the variables that are used in a duration formula, the user needs to manually re-schedule the plan using the re-schedule button in order to get updated values.

*Algebraic operators *

Basic algebraic operators are supported as follows:

- Multiply using *
- Divide using /
- Sum using +
- Subtract using -
- Parentheses ( ) can be used to define order of operations.

*Other areas of ALICE where formulas are supported*

In addition to the planned duration field in the plan page, users can input formulas in the Excel export file, to be imported back into ALICE as an updated plan.

Formula fields are currently supported in the Task tab in the column labeled duration equation, and in Task Equipment and Task Material tabs in the required amount column. The same formatting rules apply: snake case and standard algebraic operators are supported.