Gantt Chart Conditional Formatting

ChaosPup

New Member
Joined
Sep 27, 2021
Messages
48
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm making a Gantt Chart for a new job, and I'm struggling with the last part of the conditional formatting (thanks to DanteAmor for the earlier solutions).

At the moment, the planned days bar appears in blue based on the value entered in the 'Planned Days' column. If the 'Actual Days' value is greater than the 'Planned Days' value, these extra days are added to the end of the bar in red. This conditional formatting all works fine.

The last part I'm struggling with is - if the 'Actual Days' is LESS than the 'Planned Days', I'd like to 'back-fill' the relevant number of days in green. See below for an example.

In the screenshots below, I've used row 9 as an example and manually changed the colour of the cells so I can explain better.

In the first screenshot, you can see that there is no 'Actual Days' value entered, so the bar only appears in blue. In the second screenshot, I've entered 6 as the 'Actual Days', so the last 6 cells of the bar have changed to green. If I'd entered 10 as the 'Actual Days', the last 2 cells of the bar would have changed to green, and if I'd entered 3 as the 'Actual Days' the last 9 cells of the bar would have changed to green, etc. I hope this explains it OK.

All help welcome! Thanks!

PLANNED.png


ACTUAL.png
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
the conditional formatting (thanks to DanteAmor for the earlier solutions).

At the moment, the planned days bar appears in blue based on the value entered in the 'Planned Days' column. If the 'Actual Days' value is greater than the 'Planned Days' value, these extra days are added to the end of the bar in red. This conditional formatting all works fine.
Could you share that Conditional Formatting rule(s)? That may well provide a good starting point for the additional request.
 
Upvote 0
Could you share that Conditional Formatting rule(s)? That may well provide a good starting point for the additional request.
Of course, apologies I should have thought of that. See screenshots for the blue and red bars (both of which work perfectly)

Blue.png
Red.png
 
Upvote 0
See screenshots for the blue and red bars (both of which work perfectly)
Thanks. I've shortened those rules marginally. Also, for the future, please consider giving sample data (including conditional formatting) with XL2BB as we can copy the data rather than having to manually type it out. :)

See if this does what you want. Check the order of the rules.

23 09 07.xlsm
DEFGHIJKLMNOPQRSTUVWXY
62345678910111213141516
7PlannedActual
8
92/10/202313/10/20231213
102/10/202313/10/2023
112/10/202313/10/202312
122/10/202313/10/20231210
134/10/202312/10/2023912
Gantt
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K9:Y13Expression=AND($D9<>"",$D9<=K$6,K$6<=$E9-IF($G9="",0,MAX($F9-$G9,0)))textNO
K9:Y13Expression=AND($D9<>"",$G9<>"",$G9<$F9,K$6>=$D9+$G9,K$6<=$E9)textNO
K9:Y13Expression=AND($D9<>"",$D9<=K$6,$D9+$G9-1>=K$6)textNO
 
Upvote 0
Solution
You're welcome. Thanks for the confirmation. :)
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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