Overlapping conditional formatting

Sacruzsa

New Member
Joined
Feb 28, 2022
Messages
29
Office Version
  1. 2019
Platform
  1. Windows
Hello everyone,

I have a problem with our staff calendar, in Belgium (Dutch part and French part) the school holidays are different from the new school year, and since I work in a bilingual unit, both holidays have to be placed in the agenda, so it is now starting to look a bit like a coloring book.
Now I was wondering if it was possible to give overlapping conditional formats a different color or shading of the 2 colors used, just a matter of keeping it clean

As you can see I use green for the Dutch holidays and a kind of pink for the French holidays, these overlap each other and I would like to give this a different color or shading of both colors, just a matter of keeping it clear

SitPers Staff 2023-2024.xlsm
DMDNDODPDQDRDSDTDUDVDWDXDYDZEAEBECEDEEEFEGEH
10SaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesday
1118/02/202319/02/202320/02/2321/02/2322/02/2323/02/2324/02/2325/02/202326/02/202327/02/2328/02/23
12AMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPM
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Sitpers 2023
Cells with Conditional Formatting
CellConditionCell FormatStop If True
U13:ABV26Cell Valuecontains "DO"textYES
U13:ABV26Cell Valuecontains "HAN"textYES
U13:ABV26Cell Valuecontains "ATG"textYES
U13:ABV26Cell Valuecontains "AMV"textYES
U13:ABV26Cell Valuecontains "SHU"textYES
U13:ABV26Cell Valuecontains "U2"textYES
U13:ABV26Cell Valuecontains "U1"textYES
U13:ABV26Cell Valuecontains "PRG"textYES
U13:ABV26Cell Valuecontains "OPS"textYES
U13:ABV26Cell Valuecontains "M"textYES
U13:ABV26Cell Valuecontains "FMN"textYES
U13:ABV26Cell Valuecontains "SP"textYES
U13:ABV26Cell Valuecontains "PRM"textYES
U13:ABV26Cell Valuecontains "Z"textYES
U13:ABV26Cell Valuecontains "SW"textYES
U13:ABV26Cell Valuecontains "HW"textYES
U13:ABV26Cell Valuecontains "SPE"textYES
U13:ABV26Cell Valuecontains "RP"textYES
U13:ABV26Cell Valuecontains "TP"textYES
U13:ABV26Cell Valuecontains "R"textYES
U13:ABV26Cell Valuecontains "V"textYES
U13:ABV26Cell Valuecontains "A"textYES
U13:ABV26Cell Valuecontains "AGR"textYES
U13:ABV26Cell Valuecontains "TBC"textYES
U13:ABV26Cell Valuecontains "Q"textYES
U13:ABV26Cell Valuecontains "P"textYES
U10:ABV26Expression=WEEKDAG(ZOEKEN(9^9;$U$11:U$11);2)>5textNO
U10:ABV26Expression=SOMPRODUCT((T$11>=Holiday!$B$18:$B$22)*(T$11<=Holiday!$C$18:$C$22))textYES
U10:ABV26Expression=SOMPRODUCT((U$11>=Holiday!$B$18:$B$22)*(U$11<=Holiday!$C$18:$C$22))textYES
U10:ABV26Expression=VERGELIJKEN(T$11;Holiday!$B$2:$B$13;0)textYES
U10:ABV26Expression=VERGELIJKEN(U$11;Holiday!$B$2:$B$13;0)textYES
U10:ABV26Expression=SOMPRODUCT((S$11>=Holiday!$B$18:$B$22)*(S$11<=Holiday!$F$18:$F$22))textYES
U10:ABV26Expression=SOMPRODUCT((R$11>=Holiday!$B$18:$B$22)*(R$11<=Holiday!$E$18:$F$22))textYES
Cells with Data Validation
CellAllowCriteria
DM13:EH26List=$R$28:$R$53


SitPers Staff 2023-2024.xlsm
ABCDEF
17Schoolvakantie NLBegindatumEinddatumSchoolvakantie FRBegindatumEinddatum
18Herfstvakantie31/10/20236/11/2023Herfstvakantie23/10/20235/11/2023
19Kerstvakantie26/12/20228/01/2023Kerstvakantie25/12/20227/01/2023
20Krokusvakantie20/02/202326/02/2023Krokusvakantie20/02/20235/03/2023
21Paasvakantie3/04/202316/04/2023Paasvakantie29/04/202312/05/2023
22Zomervakantie30/06/202331/08/2023Zomervakantie6/07/202326/08/2023
Holiday


Thanks for the help
 
I am using 2 COUNTIFS to check if date fell into both holidays: COUNTIFS + COUNTIFS >1
NOTE: I am using LOOKUP to refer to nearest-left-cell in a merge area
LOOKUP(2,1/($U$11:U$11<>"")

Sample-CC.xlsx
UVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAP
10SaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesday
1118/02/202319/02/202320/02/202321/02/202322/02/202323/02/202324/02/202325/02/202326/02/202327/02/202328/02/2023
12AMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPM
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Sitpers 2023
Cells with Conditional Formatting
CellConditionCell FormatStop If True
U13:AP26Expression=COUNTIFS(Holiday!$B$18:$B$22,"<="&LOOKUP(2,1/($U$11:U$11<>""),$U$11:U$11),Holiday!$C$18:$C$22,">="&LOOKUP(2,1/($U$11:U$11<>""),$U$11:U$11))+COUNTIFS(Holiday!$E$18:$E$22,"<="&LOOKUP(2,1/($U$11:U$11<>""),$U$11:U$11),Holiday!$F$18:$F$22,">=" & LOOKUP(2,1/($U$11:U$11<>""),$U$11:U$11))>1textNO
 
Upvote 0
I am using 2 COUNTIFS to check if date fell into both holidays: COUNTIFS + COUNTIFS >1
NOTE: I am using LOOKUP to refer to nearest-left-cell in a merge area
LOOKUP(2,1/($U$11:U$11<>"")

Sample-CC.xlsx
UVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAP
10SaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesday
1118/02/202319/02/202320/02/202321/02/202322/02/202323/02/202324/02/202325/02/202326/02/202327/02/202328/02/2023
12AMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPMAMPM
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Sitpers 2023
Cells with Conditional Formatting
CellConditionCell FormatStop If True
U13:AP26Expression=COUNTIFS(Holiday!$B$18:$B$22,"<="&LOOKUP(2,1/($U$11:U$11<>""),$U$11:U$11),Holiday!$C$18:$C$22,">="&LOOKUP(2,1/($U$11:U$11<>""),$U$11:U$11))+COUNTIFS(Holiday!$E$18:$E$22,"<="&LOOKUP(2,1/($U$11:U$11<>""),$U$11:U$11),Holiday!$F$18:$F$22,">=" & LOOKUP(2,1/($U$11:U$11<>""),$U$11:U$11))>1textNO
Hi, thanks for the response, but I can't get it to work, I keep getting errors
 
Upvote 0
Try to test by: put that formula in cell U13 then copy to whole range. Where "TRUE" should be pink color range.
Sheet holiday must exists, as post #1
 
Upvote 0
Try to test by: put that formula in cell U13 then copy to whole range. Where "TRUE" should be pink color range.
Sheet holiday must exists, as post #1
Ok , now the formula works but nothing happens , I changed the order but it has no effect , is there a possibility to upload the file ?
 
Upvote 0
=SUMPRODUCT(--(DM$11>=holidays!$B$18:$B$22)*--(DM$11<=holidays!$C$18:$C$22))+SUMPRODUCT(--(DM$11>=holidays!$E$18:$E$22)*--(DM$11<=holidays!$F$18:$F$22))=2

Place this at the top in conditional formatting and tick stopif true
 
Upvote 0
=SUMPRODUCT(--(DM$11>=holidays!$B$18:$B$22)*--(DM$11<=holidays!$C$18:$C$22))+SUMPRODUCT(--(DM$11>=holidays!$E$18:$E$22)*--(DM$11<=holidays!$F$18:$F$22))=2

Place this at the top in conditional formatting and tick stopif true
i'm geting this error
 

Attachments

  • Schermafbeelding 2022-12-13 120204.png
    Schermafbeelding 2022-12-13 120204.png
    11.4 KB · Views: 9
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Overlapping conditional formatting
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
The sheet name is Holiday not holidays. Correct the formula and maybe it will work.
Ok thanks in advance for this first aid now starting to get somewhere.
Code works now but now the problem is that only the left cell is colored, could this be because I merged cells?
 

Attachments

  • Schermafbeelding.png
    Schermafbeelding.png
    20 KB · Views: 9
Upvote 0

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