Tech Tip: How to show calendar day duration in MS Project
This has very little to do with knowledge management or my other favorite blog topics. But it does have a lot to do with the work I have been doing lately in project management and Critical Chain Project Management.
How in the world do you get MS Project to show you the calendar-day duration of a task when the "working calendar" of the project is a 5-day work week (or a two-shift, 5-day week; or a three-shift, 7-day week)? It can't be that I have to calculate in my head from the projected start and end dates of a given task.
Amazingly, of the zillions of data elements in MS Project, there is no data column that gives you this information directly. I asked around some colleagues and someone finally pointed that you can do calculations in some of the columns by using a Customized Field and adding a formula. Unfortunately, you can't do a simple Excel-like calculation. It's a function - but the basic idea is that you need to know the number of calendar days between the start and end of the task. Simple, no?
Here are the steps to do this in MS Project 2007.
- In the project Gantt Chart view, right click on the column headers and select the Insert Column option.
- In the dialog that appears, select Field Name "Number1," set the title to "Calendar Days," and pick your desired alignment, and click OK. This will insert a column with this name.

- Now we need to add the formula. Right click on the header area again, and this time select Customize Fields. A dialog box will appear for customization. Select the radio button next to Formula under "Custom attributes." (And then respond OK to the warning that the values will be reset in the column.) Then click on the Formula button.
- Add the formula below to the text area and click OK to close both dialogs.
int(DateDiff("n",[Start],[Finish])/(24*60)+0.9)
- Now tweak the display of the column to remind you that this is a field that you can't type into. Once again, right click on the column header and pick Font. I chose to display the text in italics and Gray color. The result should look something like this.

Note: While CCPM generally eschews a focus on dates and hard durations and dates that this Tech Tip suggests, there are some types of activities which must fall along the lines of hard-and-fast durations. A big example is interactions with government bodies who tell you exactly the durations of their review times.
6 Comment(s)
Yes, of course. Elapsed time (edays, eweeks, etc) is another way to enter the data. I happen to be working wtih an overlay application that will not use eday information, so the calculation for calendar days is needed.
Great post! Very useful!
Could you please explain last part of formula (24*60)+0.9?
Regards,
Denis
www.amiproject.com - on-line Project viewer
Sure. The DateDiff function in MSProject returns the difference in minutes. Because the Start and Finish values are kept down to the minute (like Start at 15:00 on 15 Nov 2009). So to find the number of Days between Start and Finish, you need to divide by the number of minutes in a day. And round that value with the Int function.
But, since the finish might be at 08:00 the next day, the calculation would return an integer of
Jack,
Thanks for explanation. But why do not use DateDiff("d",[Start],[Finish]) which returns days and does not require to do further calculations?
The "d" option doesn't work if a "one day" task starts at 8 am and finishes at 5 pm the same day. With "d", it returns zero, which ends up not adding up across a group of tasks.


It may be that in some cases you can simplify things by using elapsed days i.e. enter a duration of 5 edays, to represent 5 calendar days, regardless of the project calendar.
@keyconsulting