0
votes

thanks in advance for the help.

I'm making a Gantt chart in Excel and am trying to integrate the capability to highlight the work week (WW). The idea is that one can select the WW from a drop down menu and the corresponding columns in the chart are highlighted. I am struggling with the conditional formatting formula to highlight the desired dates.

Here's a screen shot of how the chart is set up

I am able to highlight the column of the cell containing the WW value (e.g. in picture column I is highlighted as it contains "WW42" in cell I3. I would like to be able to highlight the days from Sunday to Saturday of each WW.

Most formulas (that I know) work on the value of the cells rather than their location or index. I have tried simply filling in all the blank cells with the WW value and then hiding the value, but the formatting isn't aesthetically pleasing and it's not efficient.

I have also tried merging the WW cells, but am unable to select all columns of the length of the merged cell, just the first column associated. For example, if I merged I3 to O3, conditional formatting will highlight that merged cell and only column I.

Any suggestions on how to approach this is greatly appreciated!

2

2 Answers

0
votes

Screenshot of my structure, showing conditional formating working as required Attached is a screenshot of my structure with my conditional formating working as required. You'll need to adjust acording to your structure, but I used a formula-based conditional formating, with the rule:

=COUNTA($B$2:B$2)=$A$1 //Where A1 contains the workweek I want to highlight

Entered into cells $B$3:$V$6. Of course, in your case you'd have to change it to something like:

=COUNTA($B$2:B$2)+41-3=$A$1

Since your work weeks start at 42 and you have 3 extra headings you dont want added on your sum (ACTUAL START, ACTUAL DURATION and PERCENT COMPLETE). Also the header for the work week has to be a numeric value, but you can play around this to get what you need. Let me know if you'd need further help.

0
votes

You do not need to use the third row for your conditional formatting, if row 4 has legal excel dates. The WEEKNUM() formula gives you exactly what you need.

If your Dropdown Menu is in cell B2 and consists of numbers from 1-52 then this should work for your conditional formatting:

=$B$2=WEEKNUM(D$1)

See attached photo.enter image description here