Gantt chart formulas and conditional formatting

BravoBravoAu

Board Regular
Joined
Nov 8, 2011
Messages
64
Office Version
  1. 2016
Platform
  1. Windows
Hey geniuses - grateful for any guidance on setting up a Gantt chart.

I've spent way too long looking for template Gantt charts and cannot work out how the formulas and conditional formatting work. I have been unable to find a suitable template that I could adapt. This was my first plan.

I have a worksheet that is basically divided in two parts:
- the left side is the details of tasks (task name, who its assigned to, its status (as a four option list), progress (as a percentage), start and finish dates).
- the right side was intended to show the progress of each task, simply by month from Dec 22 until Jun 24.

Issue 1: Initially I was thinking I could do this with conditional formatting, to fill the corresponding row for start and end month of each task. I have completed the start month, however then can't work out how to do the end month and then fill format what is between.
Issue 2: I was hoping to show percentage of progress as a change in fill relative to each task (for instance if a task was to take 4 months and was 50% completed, there would be a colour change shown for the first two months). I now doubt this is possible.
Issue 3: I was hoping to flag at risk projects with a 'tick-box' to then insert a shape within the chart. I now doubt this is possible.
Issue 4: Is there a better was to show allocated months, progress and completeness in a Gantt chart?

In short, please help. Any Gantt chart guidance would be appreciated before I lose my mind.
Cheers, BBau
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
i think most of those can be done
for example

here is part of an old gnatt chart i used as a template years ago
Where I also have milestones flagged

so it covers
point 1
NOT point 2 - but that maybe possible in a separate cell on its own showing % complete with a gradient CF
Point 3 - I have used milestone as a flag - sure that maybe changed to do what you need
Point 4 - not sure exactly what this means

There are also loads more gnatt type charts around, that i have used

anyway
what version of Excel - this example was based on 2010 version , so maybe much better ways now with 2021 or 365 and all the additional functions

Do you have a rough mockup of what you would like


Plan Gnant.xlsx
BCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
4TaskDescriptionComment - Skills / People RequiredItem StatusStart DateFinish DateDuration17 Aug 1524 Aug 1531 Aug 1507 Sep 1514 Sep 1521 Sep 1528 Sep 1505 Oct 1512 Oct 1519 Oct 1526 Oct 1502 Nov 1509 Nov 1516 Nov 1523 Nov 1530 Nov 1507 Dec 1514 Dec 1521 Dec 1528 Dec 1504 Jan 1611 Jan 16
5Tender Closed 8/20/159/12/151111000000000000000000
61footings Open 9/29/1510/10/150000001100000000000000
71.1foundations Open 10/11/1510/30/150000000111100000000000
81.2inspection Open MILESTONE11/2/15           M          
Plan
Cell Formulas
RangeFormula
I4I4=MIN(F:F)-WEEKDAY(MIN(F:F),3)
J4:AD4J4=I4+7
I5:AD8I5=IF($F5="milestone", IF(AND(I$4<=$G5, J$4>$G5),"M",""), SUM((IF((I$4<$F5-MOD($F5-2,7)),0,IF((I$4>=$F5-MOD($F5-2,7)),1,0)))-(IF((I$4<$G5),0,IF((I$4>$G5),1,0)))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I5:AZ50Expression=AND(I5=1,$E5="closed")textYES
I4Expression=AND(TODAY()>=I4,TODAY()<J4)textYES
I4Expression=TODAY()>I4textYES
I5:AZ50Expression=AND(I5="M",$E5="open")textYES
I5:AZ50Expression=AND(I$4<TODAY(),I5=1)textYES
I5:AZ50Cell Value=1textYES
I5:AZ50Cell Value=0textYES
J4:AZ4Expression=AND(TODAY()>=J4,TODAY()<K4)textYES
J4:AZ4Expression=TODAY()>J4textYES
Cells with Data Validation
CellAllowCriteria
E5:E8ListOpen, Closed


on share - I actually keep this on the share all the time, so unlike other examples i probably wont delete and will be on the forum for a while

 
Upvote 1
i have added a gradient in the duration column - But only for row 22
so H22 and H5 - so i can XL2BB

Point2
looks at the startdate and then today() and calculates the % that should be complete by today based on the start and end date
also shows the %

I think thats what you meant - as i say a sample mockup would help

EDIT - XL2BB doesnt show the gradient - CF - no idea why not - so have a link at bottom

Plan Gnant-v2.xlsx
BCDEFGHIJKLMNO
4TaskDescriptionComment - Skills / People RequiredItem StatusStart DateFinish DateDuration28 Sep 1505 Oct 1512 Oct 1519 Oct 1526 Oct 1502 Nov 1509 Nov 15
5Tender Closed 1/21/233/22/2350.00%0000000
Plan
Cell Formulas
RangeFormula
I4I4=MIN(F:F)-WEEKDAY(MIN(F:F),3)
J4:O4J4=I4+7
F5F5=TODAY()-30
G5G5=TODAY()+30
H5H5=(TODAY()-F5)/(G5-F5)
I5:O5I5=IF($F5="milestone", IF(AND(I$4<=$G5, J$4>$G5),"M",""), SUM((IF((I$4<$F5-MOD($F5-2,7)),0,IF((I$4>=$F5-MOD($F5-2,7)),1,0)))-(IF((I$4<$G5),0,IF((I$4>$G5),1,0)))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H5Other TypeDataBarNO
I5:AZ50Expression=AND(I5=1,$E5="closed")textYES
I4Expression=AND(TODAY()>=I4,TODAY()<J4)textYES
I4Expression=TODAY()>I4textYES
I5:AZ50Expression=AND(I5="M",$E5="open")textYES
I5:AZ50Expression=AND(I$4<TODAY(),I5=1)textYES
I5:AZ50Cell Value=1textYES
I5:AZ50Cell Value=0textYES
J4:AZ4Expression=AND(TODAY()>=J4,TODAY()<K4)textYES
J4:AZ4Expression=TODAY()>J4textYES
Cells with Data Validation
CellAllowCriteria
E5:E49ListOpen, Closed




 
Upvote 1
Thanks @etaf - I've managed to merge some of your great suggestions into my existing worksheet. Thank you. I'm using Excel 2016.

If anyone else has contributions - please chip in!

What I have left to resolve is the actual Gantt chart, which I can't seem to work out, even with your sample! Admittedly, I made it more complicated with the 'milestone' issue.

Column C is tasks (C5:C72 presently).
Column G is a Status List (Not Commenced, In Progress, Complete and On Hold).
Column J is Start Date.
Column M is Expected Completion date.
Column Q:AO are months (Dec 22 - Dec 24) - more than shown below..

I would like to colour fill the relevant rows of months between the 'start date' and 'Expected completion date'. I would like the colour of fill to be dependent on the status. For instance: Not Commenced = grey, In Progress = orange, Complete = green and On Hold = red).

Below is a simpler version with a small amount of relevant data.

Column CColumn GColumn JColumn MColumn QColumn RColumn SColumn TColumn UColumn VColumn W
Row 2TasksStatusStart DateExpected completionDec 22Jan 23Feb 23Mar 23Apr 23May 23Jun 23
Row 5Draft PlanComplete1 Dec 2228 Feb 23Fill greenFill greenFill green
Row 6Consult PlanIn Progress1 Mar 231 May 23Fill orangeFill orange Fill orange
Row 7Finalise PlanNot Commenced1 May 2314 May 23Fill greyFill grey
Row 8Board ApprovalNot Commenced1 Jun 231 June 23Fill grey

Gee I hope this makes sense. Obviously When either 'start date' or 'expected completion' are changed, the fill needs to adjust. I have a sample workbook but I can't access XL2BB on this laptop to post it. Hopefully this is enough information for you!
 
Upvote 0
Three rules setup in Conditional Formatting - 1 for each colour

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
$R$5:$X$8 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=AND((R$2>=$M5-(DAY($M5)-1)),R$2<=$Q5,$J5="Not Commenced")

Format [Number, Font, Border, Fill] - Fill Greu
choose the format you would like to apply when the condition is true
OK >> OK

Setup rule for each colour

Grey
=AND((R$2>=$M5-(DAY($M5)-1)),R$2<=$Q5,$J5="Not Commenced")
Orange
=AND((R$2>=$M5-(DAY($M5)-1)),R$2<=$Q5,$J5="in Progress")
Green
=AND((R$2>=$M5-(DAY($M5)-1)),R$2<=$Q5,$J5="complete")

Gantt Chart Monthly.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXY
1
2TasksStatusStart DateExpected completionDec-22Jan-23Feb-23Mar-23Apr-23May-23Jun-23
3
4
5Draft PlanComplete12-Dec-2228-Feb-23
6Consult PlanIn Progress18-Mar-231-May-23
7Finalise PlanNot Commenced1-May-2314-May-23
8Board ApprovalNot Commenced12-Jun-2318-Jun-23
9
10
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
R5:X10Expression=AND((R$2>=$M5-(DAY($M5)-1)),R$2<=$Q5,$J5="Not Commenced")textYES
R5:X8Expression=AND((R$2>=$M5-(DAY($M5)-1)),R$2<=$Q5,$J5="in Progress")textYES
R5:X8Expression=AND((R$2>=$M5-(DAY($M5)-1)),R$2<=$Q5,$J5="complete")textYES



On a share dropbox, I will keep this on the share as a monthly Gantt chart
 
Upvote 1
Solution
Thanks again @etaf - your advice has been amazing!

I worked out why I was having so much trouble - the date in my header (R2:AO2) was coming from somewhere else as text! Quickly resolved once I realised.
 
Upvote 0
you are welcome
glad its all resolved for you
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top