Excel Gantt Chart with Conditional Formatting (2 Examples)

Gantt Chart is a widely used chart in the managemental branch of any organization. It displays the activities of that institution against the time scale. In this article, we are going to demonstrate two easy examples of creating an Excel Gantt chart with conditional formatting. If you are also curious, download our practice workbook and follow us.


What Is Gantt Chart?

Gantt chart is a popular chart in the managemental section of any organization. This type of chart is widely used for project management. It will show us the activities of that industry against the time scale. Every activity is usually represented through a bar. In addition, the position and the length of any bar show the start date, duration, and end date of the following activity.


Excel Gantt Chart with Conditional Formatting: 2 Examples

Consider a dataset of five projects with multiple start and end dates to make the Gantt chart. The name of the projects is in the range of cells B5:B9. In addition, the starting and finishing dates of the corresponding project are in the range of cells C5:C9 and D5:D9, respectively.


1. Creating Simple Gantt Chart with Conditional Formatting

In this example, we are going to show the procedure to create an Excel Gantt chart with conditional formatting. The steps of this procedure are given as follows:

📌 Steps:

  • First of all, write down all the dates 1 July-15 July in the range of cells E4:S4.

  • Now, select the range of cells E5:S9.
  • In the Home tab, click on the drop-down arrow of the Conditional Formatting option from the Styles group.
  • Then, select the New Rule option.

Creating Simple Gantt Chart with Conditional Formatting

  • As a result, a small dialog box called New Formatting Rule will appear.
  • After that, choose the Use a formula to determine which cells to format option.
  • Write down the following formula into the empty box using the AND function.

=AND(E$4>=$C5,E$4<=$D5)

  • Now, click on the Format option.

Creating Simple Gantt Chart with Conditional Formatting

  • As a result, another dialog box called Format Cells will appear.
  • Then, in the Fill tab, choose your desired background color. For our chart, we chose Orange, Accent 2 color.

  • Click OK to close the Format Cells dialog box.
  • Again, click OK to close the New Formatting Rule dialog box.

Creating Simple Gantt Chart with Conditional Formatting

Creating Simple Gantt Chart with Conditional Formatting

Thus, we can say that our formula worked perfectly, and we were able to create a simple Excel Gantt chart with conditional formatting.


2. Gantt Chart with Conditional Formatting Based on Categories

In the following example, we will show how to create an Excel Gantt chart with conditional formatting based on categories. The steps of this process are given below:

📌 Steps:

  • In this example, first, we have to estimate the duration of the projects.
  • For that, write down the following formula into cell E5 using the DAYS function.

=DAYS(D5,C5)+1

  • Press Enter.

Excel Gantt Chart with Conditional Formatting Based on Categories

  • Now, double-click on the Fill Handle icon to copy the formula up to cell E9.

  • After that, we wrote the Status of our projects in the range of cells F5:F9. We have chosen three different statuses for our projects Completed, In Progress, and Pending. These are the categories of our chart.

Excel Gantt Chart with Conditional Formatting Based on Categories

  • Then, to get the first 15 days date of our desired month, write down the following formula into cell G4. In this case, the SEQUENCE and DATE functions will help us.

=SEQUENCE(1,15,DATE(2022,7,1),1)

🔍 Breakdown of the Formula

👉 DATE(2022,7,1): This function returns the first date of the month of July, 7/1/2022.

👉 SEQUENCE(1,15,DATE(2022,7,1),1): This formula get the first starting point from the DATE function. Then, the function returns the other 15 dates in a row and 15 columns with unit intervals.

  • Again, press Enter.
  • You will get all the dates from 1 July-15 July in the range of cells G4:U4.

Excel Gantt Chart with Conditional Formatting Based on Categories

  • Now, we have to apply the general conditional formatting like the previous example.
  • For that, select the range of cells G5:U9.
  • After that, in the Home tab, click on the drop-down arrow of the Conditional Formatting option from the Styles group.
  • Afterward, choose the New Rule option.

Excel Gantt Chart with Conditional Formatting Based on Categories

  • As a result, a small dialog box called New Formatting Rule will appear.
  • Then, choose the Use a formula to determine which cells to format option.
  • Write down the following formula into the empty box using the AND function.

=AND(G$4>=$C5,G$4<=$D5)

  • At last, click on the Format option.

Excel Gantt Chart with Conditional Formatting Based on Categories

  • As a result, another dialog box called Format Cells will appear.
  • Now, in the Fill tab, choose your desired background color. For our chart, we chose Orange, Accent 2 color.

  • Click OK to close the Format Cells dialog box.
  • Again, click OK to close the New Formatting Rule dialog box.
  • You will see that the chart is showing our chosen color.

Excel Gantt Chart with Conditional Formatting Based on Categories

  • Now, we are going to apply the cell formatting based on our category.
  • Select the range of cells G5:U9 and follow the same procedure to open the New Formatting Rule dialog box.
  • Then, write down the following formula.

=AND(G$4>=$C5,G$4<=$D5,$F5="Completed")

Excel Gantt Chart with Conditional Formatting Based on Categories

  • Choose a different color for this category. We chose Green, Accent 6, Darker 50% color.

  • You will see that the projects whose status is “Completed” show our selected color.

Excel Gantt Chart with Conditional Formatting Based on Categories

  • Similarly, write down the following formula for the In Progress criteria.

=AND(G$4>=$C5,G$4<=$D5,$F5="In Progress")

Excel Gantt Chart with Conditional Formatting Based on Categories

  • Choose a color for this category according to your desire. We chose Green, Accent 6, Lighter 40% color.

  • You will get the In Progress projects showing our selected color.

Excel Gantt Chart with Conditional Formatting Based on Categories

  • Finally, create another formatting rule for the Pending category.
  • For this category, write down the following formula in the New Formatting Rule dialog box.

=AND(G$4>=$C5,G$4<=$D5,$F5="Pending")

Excel Gantt Chart with Conditional Formatting Based on Categories

  • Choose another distinguishable color from the Fill tab of the Format Cells dialog box. We chose Red for this category.

  • Close all the dialog boxes and you will get the complete Gantt chart.

Excel Gantt Chart with Conditional Formatting Based on Categories

At last, we can say that all of our formulas worked successfully, and we were able to create an Excel Gantt chart with conditional formatting based on categories.


Download Practice Workbook


Conclusion

That’s the end of this article. I hope that this article will be helpful for you and you will be able to create an Excel Gantt chart with conditional formatting. Please share any further queries or recommendations with us in the comments section below if you have any further questions or recommendations. Keep learning new methods and keep growing!


Related Articles


<< Go Back to Gantt Chart Excel | Excel Charts | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Soumik Dutta
Soumik Dutta

Soumik Dutta, having earned a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, plays a key role as an Excel & VBA Content Developer at ExcelDemy. Driven by a profound passion for research and innovation, he actively immerses himself in Excel. In his role, Soumik not only skillfully addresses complex challenges but also demonstrates enthusiasm and expertise in gracefully navigating tough situations, underscoring his unwavering commitment to consistently deliver exceptional, high-quality content that... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo