Loading...
Quick Links

5 Tips for Formatting Text on a Gantt Chart

Microsoft Project 2007 offers many features to customize the components of a Gantt chart. If you’re presenting your schedule using a Gantt chart, you can use Project 2007’s advanced formatting features to visually emphasize the crucial project data displayed on the chart. I’ll demonstrate five techniques herewith by using the short sample schedule shown in Figure 1.

Figure 1. Our sample schedule.

5 Tips for Formatting Text on a Gantt Chart

Note:Always do formatting on a copy of your original project plan file and use that copy for the presentation.

Tip 1. How to Change the Date Display Format on the Gantt Chart

Project displays milestone dates by default on a Gantt chart. Date display format applies to all the dates displayed on the chart, and it can be easily changed in the Layout dialog box as follows: Right click at any point in the blank chart area to open the shortcut menu and then select Layout on the menu. In the Layout dialog box, select a date format in the Date format box and click OK.

Figure 2. The shortcut menu and Layout dialog box.

5 Tips for Formatting Text on a Gantt Chart

Note that if you select Default on the list, the Date format selection on the View tab of the Options dialog box in the Tools menu determines the date display format for all the Gantt chart dates.

Tip 2. How to Change the Position of the Date Displayed on a Milestone

As Figure 1 shows, there’s a deadline arrow just on the top of the date displayed on the right of the milestone. It’s possible to place the milestone date to another position — to the left, up, down or inside the milestone diamond.

The left of the milestone diamond seems the best position to place the date. To change the position, double-click the diamond to open the Format Bar dialog box and then click the Bar Text tab. Delete Finish field in the Right box and then enter or select Finish in the Left box as shown in Figure 3.

Figure 3. The Format Bar dialog box.

5 Tips for Formatting Text on a Gantt Chart

Click OK button to close the dialog box and apply the changes that you’ve made. The date will now be displayed on the left of the diamond as shown in Figure 4.

Figure 4. The milestone date on the left.

5 Tips for Formatting Text on a Gantt Chart

Note that the new setting will apply only to the Finish – Ph A milestone. The Bar Styles dialog box is used to change the position of the date displayed for all the existing milestones and the new ones to be created. There are several ways to open the Bar Styles dialog box as listed below:

Right click at any point in the blank chart area to open the shortcut menu and then select Bar Styles command on the menu.
Or double-click at any point in the blank chart area.
Or use the Bar Styles menu command on the Format menu.

In the Bar Styles dialog box, click the Milestone line on the Name column and then make the necessary changes in the Text tab in exactly the same way as you did in the Format Bar dialog box. Click OK to close the dialog box and apply changes to all the milestone dates on the chart.

Tip 3. How to Change Text Formatting of the Milestone Date

We can change the format of the milestone text displayed by using the Text Styles dialog box. To open the dialog box, select the Text Styles menu command on the Format menu. Then select Bar Text – Left on the Item to Change drop-down list.

Figure 5. The Text Styles dialog box.

5 Tips for Formatting Text on a Gantt Chart

You can select underlining and change the font, font style, size, and color of the text displayed by using the Text Styles dialog box. Click OK to close the dialog box and apply any changes that you’ve made.

Note that the Background Color and Background Pattern boxes for the “Bar Text” in Text Styles dialog box are grayed out.

Tip 4. How to Display More than One Field in the Same Position

It’s possible to display more than one field at any position of the Gantt chart bars, including the milestones.

As an example, we can display both the milestone name and the date on the left of the milestone diamond (or bar). To do this, it’s necessary to combine both values in a custom text field by using a simple expression and then select the custom field name in the Left box of the Bar Text tab (see Figure 3). Project will display the value returned by the expression on the left of the milestone diamond. Steps are as follows:

1. To open the Custom Fields dialog box, apply the following command sequence: Tools menu | Customize menu command| Fields… submenu command.

2. In the Custom Fields dialog box, select Text1 field and click the Rename… button; then enter BAR_INFO in the Rename Field dialog box and click OK to return to the Custom Fields dialog box.

Figure 6. The Custom Fields dialog box.

5 Tips for Formatting Text on a Gantt Chart

3. Click the Formula… button to open the Formula for “BAR_INFO” dialog box. We’re now going to build an expression to combine the field values in the Edit formula box below the BAR_INFO= label.

Figure 7. The Edit Formula dialog box.

5 Tips for Formatting Text on a Gantt Chart

A simple expression (or formula) would be as follows: [Name] & [Finish]. We can type the formula in or build it by using the buttons.

Brackets around the field names are required by syntax. If you insert a field name to the formula by selecting from the list opened by clicking the Field button, Project will automatically put brackets around the field name.

Ampersand (“&”), one of the operators available, is called a string concatenation operator. It combines two strings into a single string. You can select any operator from the Formula Toolbar to build an expression.

4. Now let’s make a couple of improvements in the formula. It’s possible to display the date in a format independent of the date display format setting in the Layout dialog box. For this purpose, we’ll use the ProjDateConv and Ucase function in the formula. Those functions can be found in the Conversion and Text submenu of the Function button list. Click the Help button to have more information on the functions and operators.

Instead of the [Finish] expression we’re going to use the following one:

Ucase( ProjDateConv( [Finish], pjDate_mmm_dd ) )

In the above expression ProjDateConv function gets the finish date from the first parameter and then formats and returns the date as specified by the second parameter pjDate_mmm_dd.

The Ucase function converts any text in the returned value by the ProjDateConv function to uppercase. The finished expression will be as follows:

[Name] & ” – ” & Ucase(ProjDateConv([Finish],pjDate_mmm_dd))

with a hyphen and spaces added in between the date and the task name for clarity. Cut, copy, and paste functions work in the formula box.

5. Enter the formula in the formula box and then click OK. A confirmation dialog box will pop up. Click OK again to close it. Click OK once again in Custom Fields dialog box to close it.

Project will now automatically evaluate the formula and populate the BAR_INFO field on each task line with the returned string value. We don’t need to add BAR_INFO field to the table.

6. Next, we’ll display the BAR_INFO value only for the milestone Finish – Ph A. Double-click the diamond and replace Finish with BAR_INFO by selecting from the field list in the Bar Text tab of the Format Bar dialog box (To browse quickly to the fields starting with “T”, just press <T> on the keyboard.)

Figure 8. The Format Bar dialog box.

5 Tips for Formatting Text on a Gantt Chart

7. Click OK to close the dialog box and apply the change. The Gantt chart will look like Fgure 9.

Figure 9. The milestone name and date now display on the left.

5 Tips for Formatting Text on a Gantt Chart

Tip 5. How to Change Background Formatting of Gantt Chart Text

The Background Color and Background Pattern boxes for the “Bar Text” in the Text Styles dialog box are grayed out. We’re going to draw a colored rectangle and use it as a background to the text.

1. Display Drawing toolbar by selecting from the Toolbars submenu (View menu).

2. Draw a rectangle below the milestone text and make it big enough to cover all the text.

3. Right click on the rectangle to open the shortcut menu and select the Properties menu command. The Format Drawing dialog box will open. In the Line & Fill tab select none for line and yellow for custom fill color. In the Size & Position tab attach the rectangle to the left of the task ID # 4 (Finish – Ph A milestone) as shown in Figure 10.

Figure 10. Attach the rectangle to the milestone.

5 Tips for Formatting Text on a Gantt Chart

Now the rectangle will move together with the milestone on the schedule.

4. Next, reposition the yellow rectangle over the text displayed by using the mouse. Project will automatically adjust Horizontal and Vertical values in the Format Drawing dialog box. Resize the rectangle if necessary. Right click the rectangle and select Order in the shortcut menu and then select Send To Back in the submenu (Figure 11).

Figure 11. Place the yellow rectangle as background to the text.

5 Tips for Formatting Text on a Gantt Chart

The chart will look like Figure 12.

Figure 12. Text with colored background

5 Tips for Formatting Text on a Gantt Chart

5. Save the file.

If we now change the task durations, the text position and date value will be adjusted accordingly as seen in Figure 13. On the other hand, if we change the date display format, the milestone date display format won’t be affected.

Figure 13. Text with a colored background with a new position and string value adjusted automatically. The date display format remains unchanged.

5 Tips for Formatting Text on a Gantt Chart

 


Related Content

Webinars (watch for free now!):
Back to the Future – When Gantt has Style

Articles:
Storytelling with Your Gantt Chart


Ismet Kocaman
Written by Ismet Kocaman

Ismet Kocaman, MCTS, PMP, is a Mechanical Engineer based in Turkey. He has more than 15 years of project management experience in the manufacturing sector. He currently provides consultancy to small to mid-sized companies on project management, reorganizing, and streamlining the manufacturing operations. He also conducts training seminars for engineers on MS Project. Contact Ismet at ikocaman.pm@gmail.com.

Share This Post
26 Comments
  1. You are great and did a marvelous work by publishing this. I was looking for this information and was getting junk. But with your help I was able to change the fonts on the Gantt chart.

    Thank you!!!

    Farrukh

    Reply
  2. Any idea how I can add a new Text Style to my project.

    I want to create a new Text Style that whenever a task/activity is 100% complete the color changes.

    Thx for any tips.

    Reply
  3. Ismet Kocaman

    Hello Guy,

    Try this;
    – Enter a formula to a task custom flag field, such as Flag10, iif( [% Complete] = 100, Yes, No )
    – In Bar Styles dialog box, define a new task bar just below the topmost one (Show For: Normal, Active, Not manually scheduled, Flag10), arrange the color formatting in anyway you want.

    I guess that will do it.
    — Ismet

    Reply
  4. Ismet, Nice content. Is there a function to repeat a task name in another line, for example, start date of line 3 in the chart inside line 1? This would be used as a summary when lines exceed 15+, more than 1 page to view. Thank you.

    Reply
  5. Ismet Kocaman

    Stan, Thank you. Formulas can only reference the data of the same task/resource for which it is evaluated, so I am afraid it is not possible, except for programming, for example, by using VBA.

    Reply
  6. please, how can i display milestone with tasks duration greater than zero

    Reply
  7. Ismet Kocaman

    Patricia,
    Just enter the formula below to a custom flag field (e.g., Flag1):
    [Milestone] AND [Duration] > 0
    You will see Yes in the flag field if a task is a milestone, and at the same time, it has a non-zero duration value.

    Reply
  8. This is a great resource, thank you for the tips.

    Once text has been added is it possible to just have the summary task text emboldened?

    Reply
  9. Ismet Kocaman

    Thank you Nathaniel.
    >> Once text has been added is it possible to just have the summary task text emboldened?
    Text can be displayed on any bar on the Gantt Chart, for example, in your case, you need to modify the summary tasks’ bar definition in the Bar Styles dialog box. But unfortunately, box must be formatted individually, it cannot be done based on the category. We cannot make the formatting of the text for a summary task different than the other ones. Best solution: modify the formatting of the bar text using the Text Styles dialog box and display text only for the summary tasks by using the Bar Styles dialog box.

    Reply
  10. how can i fix change for not repeating the steps of change

    Reply
  11. Thanks, very helpful.
    I tried the following
    ProjDateValue([Start]) & “, ” & [Name]

    to get something of the form:
    15/06/2016, XXX Task name

    The date formatting works OK if I dont have the & “, ” & [Name] in the formula, but the moment I add it back in, the formula produces a date and time.

    I’m assuming this is a bug.

    Are you aware of any other workarounds? The Date() function didn’t work either, returning an error.

    Thanks,

    Reply
  12. Ismet Kocaman

    Kim,
    Thank you for reading the article. Please try the formula below:
    Format( [Start], “dd/mm/yyyy” ) & “,” & [Name]

    So why this happens ? Here is the answer:
    Formula #1: ProjDateValue([Start]) <– MS Project converts the Start date to text information representing date, according to its date format setting (see Options) and then stores in the custom text field. This is what you see on the Gantt…

    Formula #2: ProjDateValue([Start]) & "," & [Name] <- During evaluation of the formula, the date and time data returned from ProjDateValue is converted to a date and time string (text) according to the system's (Windows) short date and long time format setting and the resulting text information is combined with the task name; and then MS Project stores the resulting text into the custom text field. So using the Format function enables us to control this conversion. Hope this explains it…

    Have a great day and do not forget to check the book and the articles on formulas here at http://www.msptips.com (all these are explained in the book).

    Reply
  13. Hi Ismet,
    You provided the below response in the thread back in Mar last year (from Guy). I’m having the same issue just now and have been able to enter the custom flag field with the formula, and have added the new task bar, as per your directions – however is there something missing from your suggestion in order to answer the Guy’s question i.e. how does this add a new Text Style to project? Basically, I’d like to be able to ensure that as soon as a line in my plan moves to 100% complete, the format of the line changes (i.e the text for that line becomes a light shade of grey). I can’t make the line between adding the bar style and having an additional (new) option in the ‘Items to change’ dropdown list in ‘Text Styles’. Any help you can give is appreciated…
    Thanks
    Paul H

    ——————————————————–
    Hello Guy,

    Try this;
    – Enter a formula to a task custom flag field, such as Flag10, iif( [% Complete] = 100, Yes, No )
    – In Bar Styles dialog box, define a new task bar just below the topmost one (Show For: Normal, Active, Not manually scheduled, Flag10), arrange the color formatting in anyway you want.

    I guess that will do it.
    — Ismet

    Comment by Ismet Kocaman on 03/25/2015 at 3:24 am

    Reply
  14. …apologies, typo in last message – should have read ‘…I can’t make the link between adding a bar style and having an additional (new) option in the ‘Items to change’ dropdown list in ‘Text Styles’.
    Regards
    Paul H

    Reply
  15. Hallo Paul,

    I think you should be able to do this with a highlight filter. Define a filter that tests for the 100% completion (e.g. Use the Custom Flag10 Field). In the view you want to show the greyed out lines go to Format – Text Styles and change the style for Highlighted Tasks to what you want them to look like.

    Hope it helps.
    Matthias

    Reply
  16. I need to add a date format to MSP default date formats. is there a way? YYYY-MM-DD … it was one of the default formats in previous versions !!!

    Reply
  17. Mohammad:
    You can set the date display format to YYYY-MM-DD through the Regional Settings (see Control Panel in Windows). Then you will see that all the items in MS Project’s Date format box will change accordingly. Hope this helps. — Ismet

    Reply
  18. Hi – I’m still not seeing an answer to the question raised by Guy and Paul H (I think they are the same question).
    The desire is to have the style of the Gantt Chart Bar Text vary according to some condition, for instance if the task is complete, I want the text alongside (or under/over) the bar to be blue. (In this example I’m using the colour/shape of the bar to convey some other information such as the type or owner of the task.) But it looks to me like the bar text style can only be changed across the board, so no way to use the the style (e.g. colour) of the bar text to indicate a specific condition.

    Reply
  19. Reply
  20. Category-based formatting can be applied to the bar texts by using the Text Styles dialog box. All other formatting on the bars are customized through the Bar Styles dialog box.

    Reply
  21. Ismet, I’m trying to change the font color of “Bar Text – Left” to ONLY a few bars. The option under “Text Styles” edits every bar text and I can’t figure out how to only apply to individual bars. Please advise!

    Reply
  22. @Nick K. — It is not possible to format the bar text individually.

    Reply
  23. Thanks for this great reference.

    I am looking to have the bar text refernece the task name and the duration.

    i have been tinkering with this but cannot seem to get it right…

    MS Project 2010.

    Thanks..

    Jason 516-3293438

    Reply
  24. Jason — Pls try [Name] & ” – ” & ProjDurConv( [Duration] ) in Text1.

    Reply
  25. Hi and thanks for this great info!

    I have a question related to the Gant chart and text for milestones.
    I’m using 4 different Milestones, they change color dependent on when one 100% them. This works, due to use of Baseline dates. My issue is that they all report the same text to the right of the graphical milestone. This in turns makes the text look bold. This is due to the fact that MS Project is displaying the text of more then 1 milestone at the same time/on top of each otter. This is then fixed when i 100% the milestone and it can choose from the 4 rules.
    Milestone;Finish Late
    Milestone;Finish On Time
    Milestone;Finish Early
    Milestone;Not Finished

    Is there a way for me to fix the “Bold” text issue ?

    Thanks,
    Morten

    Reply
  26. Morten, Some formulas with conditions may be utilized to handle the situation, but in my opinion, it is best to leave it as it is, since adding such extras to make it look better always complicates the whole thing unnecessarily. — Ismet

    Reply

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Please complete this equation so we know you’re not a robot. *

Thanks for submitting your comment!
You must be logged in to comment.