IT, MS Project, Project Management

[MS Project][HowTo] Total duration of a task

MS Project is really cool to organize your tasks and to do some project management stuff, but sometimes, speaking with “work days” is not really understandable for lambda people. Especially when you have some strange calendars (people working one day on two, full-time, night-shift, 40h/week, 35h/week…) it quickly become a mess.

To have a better view of our tasks, we will see how to show the Total Duration in days.

We will define the Total Duration as the number of days between “Start” and “Finish”, including non-working days. I tried with DataDiff and ProjDataDiff functions but they seem to use the project calendar, and I really wanted the raw number of days. So here the (dirty) trick:

  • Right click on a column > “Customize fields”
  • Choose “Text”
  • Name it “Total Duration”
  • Select “Formula” radio button in “Custom attributes”
  • Say “Yes” if a popup annoys you (we are creating a new field, so we do not care about what is in)
  • Click “Formula” button
  • Enter this:

Str(DateValue([Finish])-DateValue([Start]))+" days"

  • OK
  • Select “Use formula” in “Calculation for task and group summary rows”
  • OK
  • Add the field you just created (Right click on a column > “Insert Column…”)

Here you done!

—————————————————

Here are some details about how MS Project calculate things:

  • Work: Number of hours spent on a task.
  • Duration: Number of days spent on a task. It is the work divided by the number of hours per day specified in the options (Tools > Options > Calendar).

You will notice that Duration do not use the resource calendar!
e.g.:

  • resource based on 4h / day
  • project hours per day setting: 8h/day
  • task work: 8h

Task duration: 1 day (and not 2 days, as 4h is counted as a half day).