Conditional Formatting with Formula Not Working for One Row But All Others Work

dmarchand1

New Member
Joined
Jan 11, 2022
Messages
8
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hello - I am using Excel to create a simple Gantt chart for projects. Below is a snapshot of the conditional formatting rule/formula, and another snapshot of the the gantt chart sheet being produced by the formatting. For some reason, one of the rows (Row 41) will not format (fill with color) even though it is in the range (I have highlighted in yellow below). I have tried deleting the row and putting it back and it is still not working. Any thoughts suggestions?

1698695822722.png

1698696941947.png
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
The problem is that the task on row 41 is just 1 day. There is no date in row 4 that is >=2-Nov-23 and also <=2-Nov-23.

What result would you like to have for a case like this?
 
Upvote 0
The problem is that the task on row 41 is just 1 day. There is no date in row 4 that is >=2-Nov-23 and also <=2-Nov-23.

What result would you like to have for a case like this?
It doesn't have to be just a single day either. Any date range that falls between two consecutive dates in row 4 will behave the same way:

Book1
ABCDEFGHIJKLMN
1
2
3
49/4/20239/11/20239/18/20239/25/202310/2/202310/9/202310/16/202310/23/202310/30/202311/6/2023
59/12/20239/17/2023
6
710/2/202310/2/2023
8
9
10
11
12
139/27/202311/1/2023
1411/2/202311/2/2023
1510/26/202311/9/2023
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E5:N73Expression=AND(E$4>=$C5,E$4<=$D5)textNO
 
Upvote 0
Thank you both @dreid1011 and @6StringJazzer for your replies. I didn't think the fact that it was one day would be a problem because row 34 worked as intended. But now I realize that row 34 works because the same date appears row 4. I think i need to adjust my formula some how that that is just > than and < than without the =.
 
Upvote 0
My post didn't solve anything, please don't mark it as the solution. If anything, I was just pointing something out to help arrive at a solution.
 
Upvote 0
No, you still want the "=". You need to test whether there is an intersection between the start/end interval and the full week, not just crossing one day. Try this:

If task start <= week end AND task end >= week start

Excel Formula:
=AND($E5<=I$4,$D5>=H$4)
 
Upvote 0
@6StringJazzer Thank you - this looked like it worked since row 41 appears exactly as I would want. But, now, row 34 is filling two cells instead of just one. I assume this has to do with the fact that the start and/or end date matches exactly the vertical month. This would probably not happen often, but enough to drive me crazy. Not sure how to handle this type of occurrence.

1698780425731.png
 
Upvote 0
I imagine if there is a formula to solve the problem as it is laid out, but it is hard to see at this time. The only thing that would absolutely solve the problem would be to add all the days in row 4, but that seems not to be ideal.
 
Upvote 0
Remove the first "="

Change it to

Excel Formula:
=AND($E5<I$4,$D5>=H$4)
 
Upvote 1
Solution

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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