Conditional formatting for cells under a DAY date and based on two sets of Start and End Dates.

Marc101

New Member
Joined
Aug 26, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello,

I’m trying to color fill cells in a row using conditional formatting for cells that are under a DAY date and based on two sets of Start and End Dates.

I have a top row showing days in each cell in sequence (F1 is 8/1/22, G1 is 8/2/22, H1 is 8/3/22 etc.) I have a Start Date in cell D2 and End Date in cell E2.

I’m using the below formula to put a “.” in each cell in the row from the Start Date to the End Date. I’m using the “.” for conditional formatting to color fill each of those cells. The formula works with one set of Start and End Dates, but I need to add a 2nd set of Start and End Dates in the same row and also color fill those cells based the 2nd set of dates. Essentially, the end result would show two sets of cells filled in two different places on the same row based on the two sets of Start and End Dates.

I’m assuming a nested IF formula but I can’t get anything to work, I’m not very experienced with this and this may not be the cleanest way to do this, but it’s the only way I could get it to work, at least for the single set of Start/End dates.

=IF((((F1>=(DATE(YEAR($D$2),MONTH($D$2),DAY($D$2)*1)))*(F1<=(DATE(YEAR($E$2),MONTH($E$2),DAY($E$2)*1)))))=0,"",".")

Thank you in advance for any help or guidance with this.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Welcome to the MrExcel board!

Something like this? (Doesn't require the dot)
[My dates are in d/m/y format]

22 08 27.xlsm
DEFGHIJKLMNOPQ
1StartEnd1/08/20222/08/20223/08/20224/08/20225/08/20226/08/20227/08/20228/08/20229/08/202210/08/202211/08/202212/08/2022
22/08/20224/08/2022
37/08/202210/08/2022
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F2:Q2Expression=OR(F$1=MEDIAN(F$1,$D2,$E2),F$1=MEDIAN(F$1,$D3,$E3))textNO
 
Upvote 0
This is great. Thank you Peter_SSs!

How would I not fill cells where either the 1st or the 2nd set of Start and End dates are blank? and not fill where no Start or End dates are entered at all?

(I did put the 2nd set of Start/End dates on same row as the 1st Start/End dates)

Thanks!
 
Upvote 0
Try this

22 08 27.xlsm
BCDEFGHIJKLMNOPQ
1Start 1End 1Start 2End 21/08/20222/08/20223/08/20224/08/20225/08/20226/08/20227/08/20228/08/20229/08/202210/08/202211/08/202212/08/2022
22/08/20224/08/20227/08/202210/08/2022
3
43/08/20227/08/2022
510/08/202210/08/2022
CF (2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F2:Q5Expression=OR(AND(COUNT($B2:$C2)=2,F$1=MEDIAN(F$1,$B2,$C2)),AND(COUNT($D2:$E2)=2,F$1=MEDIAN(F$1,$D2,$E2)))textNO
 
Upvote 0
Solution
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,607
Members
449,090
Latest member
vivek chauhan

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