Conditional Formatting to highlight cells between to date

Stef9910

Board Regular
Joined
Nov 2, 2022
Messages
72
Office Version
  1. 2010
Platform
  1. Windows
Hello everyone,

I am constructing a gantt chart from cells in pivot table, I am having trouble with the conditional formatting to highlight cells between two dates,

The cells that say blank, were inputted by excel when creating the pivot table, they do not have dates in them.

I am using a pivot table so i can use slicers to filter what is required, as in metro/regional, locations and so on, i have not included that information with the below minisheet.

Any help will be greatly received,

Thank you

Stefan

For mini sheet.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
1Start MonthApril
2End MonthApril1-Apr-238-Apr-2315-Apr-2322-Apr-2329-Apr-23
312345678910111213141516171819202122232425262728293012345
4StatusTypeRegionHospitalDate ReceivedStart DateEnd DateRTPPERSONSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTF
5CancelledScheduledMetroHome(blank)(blank)(blank)(blank)SMITH
6HomeSMITH
7Home(blank)(blank)(blank)(blank)SMITH
8CompletedScheduledMetroHome(blank)3/04/20234/04/2023(blank)SMITH
9Home5/04/20236/04/2023(blank)SMITH
10Home(blank)4/04/20234/04/2023(blank)SMITH
11DeclinedScheduledMetroHome(blank)(blank)(blank)(blank)SMITH
12Home(blank)(blank)(blank)(blank)SMITH
13Full SitScheduledMetroHome(blank)11/04/202311/04/2023(blank)SMITH
14HomeSMITH
15Home28/04/202328/04/2023(blank)SMITH
16Home(blank)21/04/202321/04/2023(blank)SMITH
17Home(blank)14/04/202314/04/2023(blank)SMITH
18Not CompletedUnscheduledMetroHome11/04/2023(blank)(blank)13/04/2023SMITH
Sheet1
Cell Formulas
RangeFormula
J2,Q2,X2,AE2,AL2J2=J3
J3J3=I1
K3:AR3K3=J3+1
J4:AR4J4=LEFT(TEXT(J3,"ddd"),1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J5:AR18Expression=IF(AND($G$22<=$K$17,$H$22>$L$17),1,"")textNO
 

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.
Where am I going wrong in the conditional format =IF(AND($G$22<=$K$17,$H$22>$L$17),1,"") that it is not highlighting dates between G22 and H22
 
Upvote 0
Sorry, what is your question?
Where am I going wrong in the conditional format =IF(AND($G$22<=$K$17,$H$22>$L$17),1,"") that it is not highlighting dates between F8 and G8

I know the formula above states G22 and H22
 
Upvote 0
Your Mini Sheet ends at row 18, do you have more data? Could you provide it?
 
Upvote 0
Your Mini Sheet ends at row 18, do you have more data? Could you provide it?
There's too much for the minisheet, but the below has more, hope this is enough? It ends at AR100

For mini sheet.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
1Start MonthApril
2End MonthApril1-Apr-238-Apr-2315-Apr-2322-Apr-2329-Apr-23
312345678910111213141516171819202122232425262728293012345
4StatusTypeRegionHospitalDate ReceivedStart DateEnd DateRTPPERSONSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTF
5CancelledScheduledMetroHome(blank)(blank)(blank)(blank)SMITH
6HomeSMITH
7Home(blank)(blank)(blank)(blank)SMITH
8CompletedScheduledMetroHome(blank)3/04/20234/04/2023(blank)SMITH
9Home5/04/20236/04/2023(blank)SMITH
10Home(blank)4/04/20234/04/2023(blank)SMITH
11DeclinedScheduledMetroHome(blank)(blank)(blank)(blank)SMITH
12Home(blank)(blank)(blank)(blank)SMITH
13Full SitScheduledMetroHome(blank)11/04/202311/04/2023(blank)SMITH
14HomeSMITH
15Home28/04/202328/04/2023(blank)SMITH
16Home(blank)21/04/202321/04/2023(blank)SMITH
17Home(blank)14/04/202314/04/2023(blank)SMITH
18Not CompletedUnscheduledMetroHome11/04/2023(blank)(blank)13/04/2023SMITH
19Home23/04/2023(blank)(blank)28/04/2023SMITH
20Partial SitUnscheduledMetroHome9/04/202310/04/202312/04/2023(blank)SMITH
21Home15/04/202319/04/202319/04/2023(blank)SMITH
22ProvisionalUnscheduledMetroHome28/04/2023(blank)(blank)(blank)SMITH
23Sit in ProgressUnscheduledMetroHome14/04/202326/04/202330/04/2023(blank)SMITH
24Full SitScheduledRegionalHome(blank)4/04/20234/04/2023(blank)SMITH
25Not CompletedScheduledRegionalHome(blank)(blank)(blank)(blank)SMITH
26UnscheduledRegionalHome2/04/2023(blank)(blank)2/04/2023SMITH
27Home14/04/2023(blank)(blank)20/04/2023SMITH
28Full SitScheduledMetroHome(blank)12/04/202312/04/2023(blank)SMITH
29Home(blank)20/04/202320/04/2023(blank)SMITH
30Not CompletedScheduledMetroHome(blank)(blank)(blank)(blank)SMITH
31UnscheduledMetroHome17/04/2023(blank)(blank)17/04/2023SMITH
Sheet1
Cell Formulas
RangeFormula
J2,Q2,X2,AE2,AL2J2=J3
J3J3=I1
K3:AR3K3=J3+1
J4:AR4J4=LEFT(TEXT(J3,"ddd"),1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J5:AR18Expression=IF(AND($G$22<=$K$17,$H$22>$L$17),1,"")textNO
 
Upvote 0
I think I got it. Is this the result you want:

Book1.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
1Start Month45017
2End Month4504601-Apr-2308-Apr-2315-Apr-2322-Apr-2329-Apr-23
312345678910111213141516171819202122232425262728293012345
4StatusTypeRegionHospitalDate ReceivedStart DateEnd DateRTPPERSONSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTF
5CancelledScheduledMetroHome(blank)(blank)(blank)(blank)SMITH12345678910111213141516171819202122232425262728293012345
6HomeSMITH12345678910111213141516171819202122232425262728293012345
7Home(blank)(blank)(blank)(blank)SMITH12345678910111213141516171819202122232425262728293012345
8CompletedScheduledMetroHome(blank)4/3/20234/4/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
9Home4/5/20234/6/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
10Home(blank)4/4/20234/4/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
11DeclinedScheduledMetroHome(blank)(blank)(blank)(blank)SMITH12345678910111213141516171819202122232425262728293012345
12Home(blank)(blank)(blank)(blank)SMITH12345678910111213141516171819202122232425262728293012345
13Full SitScheduledMetroHome(blank)4/11/20234/11/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
14HomeSMITH12345678910111213141516171819202122232425262728293012345
15Home4/28/20234/28/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
16Home(blank)4/21/20234/21/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
17Home(blank)4/14/20234/14/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
18Not CompletedUnscheduledMetroHome4/11/2023(blank)(blank)4/13/2023SMITH12345678910111213141516171819202122232425262728293012345
Sheet1
Cell Formulas
RangeFormula
J2,Q2,X2,AE2,AL2J2=J3
J3J3=I1
K3:AR3K3=J3+1
J4:AR4J4=LEFT(TEXT(J3,"ddd"),1)
J5:AR18J5=J$3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J5:AR18Expression= AND( J$3>=$F$8, J$3<=$G$8)textNO


P.S. I formatted the cells with white Text, so it is not visible.
 
Upvote 0
Sorry, I think I was wrong.

Maybe this is what you need:

Book1.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
1Start Month45017
2End Month4504601-Apr-2308-Apr-2315-Apr-2322-Apr-2329-Apr-23
312345678910111213141516171819202122232425262728293012345
4StatusTypeRegionHospitalDate ReceivedStart DateEnd DateRTPPERSONSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTF
5CancelledScheduledMetroHome(blank)(blank)(blank)(blank)SMITH                                   
6HomeSMITH                                   
7Home(blank)(blank)(blank)(blank)SMITH                                   
8CompletedScheduledMetroHome(blank)4/3/20234/4/2023(blank)SMITH  11                               
9Home4/5/20234/6/2023(blank)SMITH    11                             
10Home(blank)4/4/20234/4/2023(blank)SMITH   1                               
11DeclinedScheduledMetroHome(blank)(blank)(blank)(blank)SMITH                                   
12Home(blank)(blank)(blank)(blank)SMITH                                   
13Full SitScheduledMetroHome(blank)4/11/20234/11/2023(blank)SMITH          1                        
14HomeSMITH                                   
15Home4/28/20234/28/2023(blank)SMITH                           1       
16Home(blank)4/21/20234/21/2023(blank)SMITH                    1              
17Home(blank)4/14/20234/14/2023(blank)SMITH             1                     
18Not CompletedUnscheduledMetroHome4/11/2023(blank)(blank)4/13/2023SMITH                                   
Sheet1
Cell Formulas
RangeFormula
J2,Q2,X2,AE2,AL2J2=J3
J3J3=I1
K3:AR3K3=J3+1
J4:AR4J4=LEFT(TEXT(J3,"ddd"),1)
J5:AR18J5= IF( AND( J$3>=$F5,J$3<=$G5), 1, "")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J5:AR18Cell Value=1textNO
 
Upvote 0
Solution
I think I got it. Is this the result you want:

Book1.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
1Start Month45017
2End Month4504601-Apr-2308-Apr-2315-Apr-2322-Apr-2329-Apr-23
312345678910111213141516171819202122232425262728293012345
4StatusTypeRegionHospitalDate ReceivedStart DateEnd DateRTPPERSONSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTF
5CancelledScheduledMetroHome(blank)(blank)(blank)(blank)SMITH12345678910111213141516171819202122232425262728293012345
6HomeSMITH12345678910111213141516171819202122232425262728293012345
7Home(blank)(blank)(blank)(blank)SMITH12345678910111213141516171819202122232425262728293012345
8CompletedScheduledMetroHome(blank)4/3/20234/4/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
9Home4/5/20234/6/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
10Home(blank)4/4/20234/4/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
11DeclinedScheduledMetroHome(blank)(blank)(blank)(blank)SMITH12345678910111213141516171819202122232425262728293012345
12Home(blank)(blank)(blank)(blank)SMITH12345678910111213141516171819202122232425262728293012345
13Full SitScheduledMetroHome(blank)4/11/20234/11/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
14HomeSMITH12345678910111213141516171819202122232425262728293012345
15Home4/28/20234/28/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
16Home(blank)4/21/20234/21/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
17Home(blank)4/14/20234/14/2023(blank)SMITH12345678910111213141516171819202122232425262728293012345
18Not CompletedUnscheduledMetroHome4/11/2023(blank)(blank)4/13/2023SMITH12345678910111213141516171819202122232425262728293012345
Sheet1
Cell Formulas
RangeFormula
J2,Q2,X2,AE2,AL2J2=J3
J3J3=I1
K3:AR3K3=J3+1
J4:AR4J4=LEFT(TEXT(J3,"ddd"),1)
J5:AR18J5=J$3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J5:AR18Expression= AND( J$3>=$F$8, J$3<=$G$8)textNO


P.S. I formatted the cells with white Text, so it is not visible.
I would only like the two cells L8 and M8 to be highlighted

Thank you for helping me
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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