Peltier Technical Services, Inc.
 

Excel Chart Add-Ins | Training | Charts and Tutorials | Peltier Tech Blog


Peltier Tech Chart Utility

 

Excel Dashboards

 

Books at Amazon.com

 

Advanced Gantt Charts in Microsoft Excel.


 

Introduction

Gantt charts are useful tools in program management, which help to show graphically when tasks must start and finish, and which tasks are underway at any given time. Gantt charts help in scheduling of the many tasks in a program, and in identifying potential resource issues in the schedule. A simple Gantt chart is merely a floating bar chart, that is, a stacked bar chart in which the first series is formatted to be invisible. The second series of bars are stacked on the first, but these bars appear to float in the middle of the chart, because the first series is formatted to be invisible. My article Gantt Charts in Microsoft Excel in Tech Trax e-zine describes this simple approach.

This example is more detailed, and therefore more complicated. There are two visible bars, so the floating bar can show fraction complete and fraction incomplete. In addition, two line chart series are added to show milestones for completed and not-yet-completed tasks. Excel will not allow an XY series to be added to a Bar-Line combination chart, so an additional line series is used as an anchor for a vertical line and label. Using a line chart allows us to use the versatile time scale axis of the line chart as the horizontal axis of the Gantt chart.

Sample Data

The table below contains the data for this example. The sections of the data range are described in more detail:

  • The green shaded range (columns A through D) contains the stacked bar data which is used to create the timelines in the chart.
     
  • The blue shaded range (columns F through I) contains the line chart data used to plot milestones and provide the time scale horizontal axis. Column I within the blue range is filled with #N/A errors, enter the formula =NA() or type #N/A in the cells. In a Line or XY chart series, no marker is plotted for #N/A; if there are valid points on both sides, the connecting line connects these valid points, interpolating across the #N/A.
     
  • The yellow shaded range below the blue shaded range is an extension of the line chart data. The yellow cells anchors the vertical line(s); add more rows to add more vertical lines. The value in the yellow cell of column F could be dynamically linked to the current date by inserting the formula =TODAY() in the cell. Columns G and H within the yellow range is filled with #N/A errors, enter the formula =NA() or type #N/A in the cells. The value of 0 in the yellow cell(s) of column I is selected to put the point at the top edge of the chart.
     
  • The milestone values in column J (0.5, 1.5, etc.), which columns G and H link to, are defined to place the Finished and Unfinished markers at the mid-height of the Done/Not Done bars.

The user enters Task Name (column A), Start Date (B), either Duration (E) or End Date (F), and Percent Complete (K), as well as the data in the yellow range. The other columns are calculated.

  A B C D E F G H I J K
1   Start Done Not Done Duration End Finished Unfinished Vert Line Milestone % Complete
2 Task 1 4/5/01 14 0 14 4/19/01 0.5 #N/A #N/A 0.5 100%
3 Task 2 4/12/01 21 0 21 5/3/01 1.5 #N/A #N/A 1.5 100%
4 Task 3 4/25/01 10.5 3.5 14 5/9/01 #N/A 2.5 #N/A 2.5 75%
5 Task 4 4/25/01 21 7 28 5/23/01 #N/A 3.5 #N/A 3.5 75%
6 Task 5 5/15/01 7 7 14 5/29/01 #N/A 4.5 #N/A 4.5 50%
7 Task 6 5/18/01 7 21 28 6/15/01 #N/A 5.5 #N/A 5.5 25%
8 Task 7 5/18/01 12.25 22.75 35 6/22/01 #N/A 6.5 #N/A 6.5 35%
9 Task 8 5/25/01 8.75 26.25 35 6/29/01 #N/A 7.5 #N/A 7.5 25%
10 Task 9 6/5/01 0 24 24 6/29/01 #N/A 8.5 #N/A 8.5 0%
11           6/1/01 #N/A #N/A 0    
Formulas

These are the formulas that make the chart work.

Formulas filled down to row 10
Cell Formula
C2: =E2*K2
D2: =E2*(1-K2)
E2*: =F2-B2
F2*: =B2+E2
G2: =IF(K2=100%,J2,NA())
H2: =IF(K2<100%,J2,NA())
J2: =ROW()-1.5
*Only E or F has formulas, depending on which is filled by the user.
Constructing the Chart

To create the chart, select the data in range F1:I11 (the blue and yellow shaded regions in the table above), start the Chart Wizard, and choose a Line chart in Step 1 of the wizard.

Delete the horizontal gridlines, and add vertical gridlines (Chart menu > Chart Options > Gridlines tab > Category Axis Major Gridlines).

Double click the horizontal (time) axis; on the Scale tab, set appropriate Minimum (4/1/01), Maximum (7/8/01), Major (14 days), and Minor (7 days) scale parameters. Also on the scale tab, uncheck the Value (Y) Axis Crosses Between Dates checkbox. On the Number tab, choose an appropriate date format (m/d).


The new chart has only primary X and Y axes.

Select and copy range A1:D10 (shaded green above), select the chart, and use Paste Special from the Edit menu to add the data as New Series.

Select the Start series, then use Chart Type on the Chart menu to change the series to a Stacked Bar type.


The chart gains a secondary Y axis when the series is converted to a bar series.

Select the Done series, and again use Chart Type on the Chart menu to change the series to a Stacked Bar type. Repeat for the Not Done series. You can use the F4 key to repeat the latest action for the Not Done series, but not for the Done series; for some reason, when you assign the Stacked Bar type to the Start series in the previous step, Excel considers it a Clustered Bar.

Choose Chart Options on the Chart menu, click on the Axes tab, and check the Secondary Category checkbox. This adds the list of tasks as axis labels.


The chart has primary and secondary X and Y axes.
The task labels (secondary X axis labels) are on the right, not the left.

Double click on the bottom time axis, and click on the Scale tab. Check the Value (Y) Axis Crosses at Maximum Value checkbox. This moves the numeric vertical axis from left to right (where the numbers temporarily overlap the task list on the right axis).

Double click on the top time axis, and click on the Scale tab. Uncheck the Category (X) Axis Crosses at Maximum Value checkbox. This moves the task list to the left side of the chart.


The chart has primary and secondary X and Y axes.
The task labels (secondary X axis labels) are on the left, where we want them.

Double click left (Task) axis, and click on the Scale tab. Check the Categories in Reverse Order box and uncheck the Value (Y) Axis Crosses at Maximum Category box, so the tasks are represented from top to bottom. Enter 1 in the Number of Categories Between Tick Mark Labels box, to force Excel to display each label.

Double click on the right numerical axis. Check the Values in Reverse Order box and also the Category Axis Crosses at Maximum Value box. Make sure the minimum and maximum are set to 0 and 9, and uncheck the Auto box in front of each, so Excel doesn't unexpectedly change the axis. If more tasks are added, both vertical axes must be rescaled in tandem. On the Patterns tab, choose None for Tick Marks and Tick Labels to hide the numbers.

Double click the top axis. Set the scale parameters to: Minimum 4/1/01, Maximum 7/8/01, Major Unit 14, Minor Unit 7 to match the bottom time axis that was formatted earlier. Even though this is a value axis that is expecting a "regular" number, Excel will accept numbers in date format. On the Patterns tab, set Tick Mark Labels to None. Note: the top and bottom time scales must be synchronized (manually) when the data changes.

Format the bar timeline series and milestone markers. Make the Start series invisible by choosing None for Border and Area on the Patterns tab. Choose appropriate colors, marker shapes, and marker sizes for the other series.

Delete the Legend, and stretch the Plot Area to fill the whole chart.

Resize the plot area, moving down the top edge to make room for a label. Double click the Vert Line series (single point in this example), and add data labels, using the Category Name option. Double click the data label, and on the Alignment tab, choose Above for Label Position.

Double click on the Vert Line series, and on the Patterns tab, select None for Line and Marker. On the Y Error Bars tab, choose Plus (it goes down, but the axis is plotted in reverse order), with a Fixed Value of 9 (to stretch from top to bottom).


The chart has primary and secondary X and Y axes.
The primary Y axis and secondary Y axis are hidden.

 

 

Page copy protected against web site content infringement by Copyscape

 

Peltier Tech Chart Utility

 

Create Excel dashboards quickly with Plug-N-Play reports.


Peltier Technical Services, Inc.

Excel Chart Add-Ins | Training | Charts and Tutorials | PTS Blog

Peltier Technical Services, Inc., Copyright © 2014. All rights reserved.
You may link to this article or portions of it on your site, but copying is prohibited without permission of Peltier Technical Services.

Microsoft Most Valuable Professional

Microsoft Most Valuable Professional

My MVP Profile