Conditional Formatting a range of blank cells based on dates on other cells

hartlieb

New Member
Joined
Apr 15, 2016
Messages
2
I have a worksheet that lists tasks in column A, Start in Column B and End in Column C. My goal is to set conditional formatting that will highlight a row with a color for the duration of time indicated by the start and end dates in the row immediately to the right of the task. Those cells would be blank and use the date (M/Y) headers in row 3 going out from D3 to CI3. ( D3 is Jan 2015, E3 is FEB 2015 and so on out to CI3) Essentially a Gannt type chart with only the duration shown on B and C.

I could fill this in by highlighting cells but there are hundreds of tasks in Column A. This excel workbook contains tons of other information that a several people use and this is but one report needed in the workbook. We have people that need to get a visual of overall timeline in relation to other data. Although this would be easy to create in MS Project, I need to keep it in excel.

I have tried all sorts of conditional formatting using greater than and less than formulas with little success
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
So I think I've found a way to make this work but it requires a few steps and I've made a few assumptions when modeling this that I'm hoping won't affect the result.

1. You have (M/Y) headers in row 3 from Column D to CI. I dragged those dates down through the entire document so that you have that same row repeated after every Task.
2. I then turned the text color white for all those rows (excluding the header) so that all the dates are there but can't be seen.
3. Now Select the first row Task 1 from D3 to CI3
4. I then set up a conditional formatting rule: Format only cells that contain:
A. Format only cells with: Cell Value >> Between >> $B3 and $C3 (You'll want to leave column values (B and C) locked but cells you'll want to be changeable based on row)
B. B3 being the task start date and C3 being the task end date
C. I formatted them so that the text color and fill color are the same color so it will look solid when conditionally formatted.
5. Apply this formatting and it should color in the cells that span that start and end time frame.
6. Now on the Home Tab on the Ribbon you'll want to use the Format Painter.
A. Select D3 to CI3 and Click Format Painter;
B. You should now be able to Drag from D4 to CI(End Row) and Conditionally format all Tasks the same.

I believe that should provide you with the solution you're looking for.
 
Last edited:
Upvote 0
startend01/01/201501/02/201501/03/201501/04/201501/05/201501/06/201501/07/201501/08/201501/09/201501/10/201501/11/201501/12/2015
task101/03/201508/09/2015XXXXXX
task225/01/201511/11/2015XXXXXXXXXX
the formula that puts X in the cell is
for task1 first date
'=IF(AND($B2 < D$1,$C2 > D$1),"X","")
work that into cond format
eg in same cell
format, conditional format, equation is
'=AND($B2 < D$1,$C2 > D$1)=TRUE

<tbody>
</tbody>
 
Last edited:
Upvote 0
I have created a few of these
So assuming you do have the Date format in the headers
then you can use a 1 for the conditional formatting

=AND( Cell with start >= Header Cell , Cell with End <= Header cell
now if the start and ends dates of that row are in the column header it should set the cell as 1

so you can setup a grid of 1's and 0's and just keep those white when they dont apply and the same colour as the fill - so never seen

i can put my example on a share if you like

it has milestones and other things in
 
Upvote 0
Meggesto

That is a pretty cool trick! -- copying the date headers and making them disappear with white. So this works perfect. The only thing that doesn't work is that the format painter copies the formatting for D3 through CI3 the same all the way down so that all the tasks show the date range for the first task. For some reason excel is not "indexing" the formatting down to relative values for each row.. Any ideas?
 
Upvote 0
didnt suggest copying the headers ?
using an IF( AND()
to set a 1 or 0
OR
as oldbrewer
suggested and X
does not matter whats used
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,942
Members
449,275
Latest member
jacob_mcbride

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