MS Project Counting Task Totals

MS Project Expert contribution - submit an article

By , MVP, PMP, MCT - MS Project & MS Project Server

When managing project schedules Project Managers often need to produce a count of various tasks.  For example:  How many late tasks are in a schedule, how many critical tasks, how many milestones, etc. There is a way to have MS Project count these tasks (Ellen Lehnert).

To allow a count to occur and accumulate you will need to create a customized field with a formula, insert that column into a task table and then apply groupings and filters.

All versions of MS Project have this ability to create customized fields with formulas. In the example below you will first create a customized number field, apply '1' into the formula, and set a roll-up value to Sum the column value.

Count the number of tasks under each summary task

Using MS Project 2010 click on: Project > Customize Fields
(Using earlier levels of MS Project, click on: Tools > Customized Fields > Fields)
To create and rename a customized Number field to be called 'Count' click on: Type > Number > Number1 (or any unused number field)
> Rename > Enter 'Count' > OK (See below)

create custom field in MS project
After the field has been created, click on Formula in the Custom attributes section and click OK to accept the warning message that all existing values will be discarded from the selected field.
custom field warning ms project
Enter 1 for the formula in the box at the top of the view, click OK to close the box and OK again to accept another warning message.
This action will place a 1 in for each detail and milestone task in the Count Field for your project.
Note: In the view below the vertical line to the right of the number 1 is the cursor. formula for custom field in ms project
The last step is to click on Rollup and select Sum in the 'Calculation for task and group summary rows' section. Then click OK to close the Customized field box.
rollup calculation in ms project
Insert the Count column into any task table view and you will note the accumulated value on the summary rows.
In the example below Outline Level 1 was applied:
View > Outline > Outline Level 1
You will notice that there are 5 tasks in the Scope section and 9 tasks in the Analysis/Software Requirements section. The Project Summary task Software Development is displaying total 74 detail and milestone tasks contained in the project schedule and is not counting summary tasks.

count tasks in ms project

Count critical tasks in MS Project

If you want to know how many critical tasks are in your project schedule, apply the Critical grouping View > Group by:'Critical', then adjust the Outline Level to Outline Level 1; you can easily see the count of the number of tasks in each category.

MS Project group by

ms project count critical tasks

To clear the Grouping click on View > No Group in MS Project 2010 or Project > Group by > No Group in earlier MS Project versions.

Count tasks by Location in MS Project

In the example below I have created a customized field called Location and populated it with some city names. I then created a Grouping called Location and applied the new group. The steps to create the new Group are:

  1. Using MS Project 2010 click on: View > Group > New Group by
  2. Using earlier levels of MS Project click on: Project > Group by > More Groups > New
  3. Name: Location
  4. Group by: Location
  5. Click OK to close the box

To view the numbers of tasks occurring at each location apply the grouping.

  1. Using MS Project 2010 click on: View > Group > Location
  2. Using earlier levels of MS Project click on: Project > Group by > Location

More task count information can be gained by applying filters. Some useful filters for this purpose could be Late tasks, Critical tasks, Uncompleted tasks, Milestone tasks, Over budget tasks, Should have started tasks, etc. After a filter is applied you can then apply an outline level to view totals.

Another filtering idea is to filter by value within a column. For example, you might want to know how many tasks contain the word 'Develop' by location. Using the location group created above apply the group and apply a custom filter View > Filter: > New Filter which contains the word 'Develop' and then apply Outline Level 1. Notice in the example below the number of occurrences per location has changed.

filter tasks that contain a particular word in ms project

Group tasks by week

One more idea is to group tasks by week and find out how many tasks should be starting in weekly timeframes.

  1. Using MS Project 2010 click on the Start column and select: Group by > Week to create the grouping quickly. You may also click on: Project > Group by > New Group by and create a grouping object.

    Using earlier levels of MS Project click on: Project > Group by > More Groups > New

  2. Name: Weekly by Start date
  3. Group by: Start
  4. Define group intervals: Each Week
  5. Click OK to close the Define Interval box
  6. Click OK to close the Group box.

Group tasks by week and count the number of tasks in each week

Below is an example of a weekly grouping with the count for number of tasks scheduled by week.

ms project count number of tasks in a week

To keep the customized fields, groupings, filters and all customized objects, copy the objects into your Global.mpt using the Organizer function.

  1. Using MS Project 2010 click on: File > Info > Organizer
    Using earlier levels of MS Project click on: Tools > Organizer
  2. Click on the tab along the top for the type of object you wish to copy
  3. Click on the object name on the right side of the view
  4. Click Copy to copy the object to your Global.mpt file
  5. Repeat until all objects are copied
  6. Click Cancel to close the Organizer box

Using the Clear Group button

Add the Clear Group button to the Quick Access bar in MS Project 2010. This button can be found in the All Commands section of the Customize Quick Access bar.
  1. On the right side of the Quick Access bar click on the down arrow
  2. Click on More Commands
  3. In the Choose commands from select the All Commands
  4. Scroll down to Clear Group and click on it
  5. Click Copy
  6. Click OK to close the box

You can add more buttons to the Quick Access bar if the bar is below the ribbon bars.

Clear Group is also a button in earlier versions that may be added to a toolbar.

About the author

Ellen Lehnert, Principle, is a Microsoft Project MVP (Most Valuable Professional), a PMP (Project Management Professional) and MCT (Microsoft Certified Trainer).

Publish your article on

Read more guides on using Microsoft Project