Fill cells with colour based on another cell colour

Manexcel

Board Regular
Joined
Dec 28, 2015
Messages
125
Office Version
  1. 2019
Platform
  1. Windows
I am using Windows 10 with Excel 2019.
1) I have a number of groups that meet at irregular periods throughout the year. This is outlined in the table below.
2) I have calculated the future the dates for each group meeting based on their meeting dates (Cols E thru to P)
3) Using conditional formatting I have highlighted, in say yellow, the meeting dates from 'today' +30 days - E19 and E20
4) Cols Q to S just control the month number, Month and day number in the week to calculate dates (based on the best formula I could find)

SS Meetings Example v0.4.xlsx
ABCDEFGHIJKLMNOPQRS
6Group NameMeeting onDayWeek202120222023202420252026202720282029203020312032Month No.Occurance in MonthDay No. in Week
7Group 13rd Tue in JanuaryTue319/01/202118/01/202217/01/202316/01/202421/01/202520/01/202619/01/202718/01/202816/01/202915/01/203021/01/203120/01/2032133
8Group 21st Thur in FebruaryThu104/02/202103/02/202202/02/202301/02/202406/02/202505/02/202604/02/202703/02/202801/02/202907/02/203006/02/203105/02/2032215
9Group 33rd Tue in FebruaryTue316/02/202115/02/202221/02/202320/02/202418/02/202517/02/202616/02/202715/02/202820/02/202919/02/203018/02/203117/02/2032233
10Group 44th Wed in FebruaryWed424/02/202123/02/202222/02/202328/02/202426/02/202525/02/202624/02/202723/02/202828/02/202927/02/203026/02/203125/02/2032244
11Group 11st Mon in MarchMon101/03/202107/03/202206/03/202304/03/202403/03/202502/03/202601/03/202706/03/202805/03/202904/03/203003/03/203101/03/2032312
12Group 21st Thur in MarchThu104/03/202103/03/202202/03/202307/03/202406/03/202505/03/202604/03/202702/03/202801/03/202907/03/203006/03/203104/03/2032315
13Group 33rd Tue in MarchTue316/03/202115/03/202221/03/202319/03/202418/03/202517/03/202616/03/202721/03/202820/03/202919/03/203018/03/203116/03/2032333
14Group 42nd Thur AprilThu208/04/202114/04/202213/04/202311/04/202410/04/202509/04/202608/04/202713/04/202812/04/202911/04/203010/04/203108/04/2032425
15Group 13rd Thu in AprilThu315/04/202121/04/202220/04/202318/04/202417/04/202516/04/202615/04/202720/04/202819/04/202918/04/203017/04/203115/04/2032435
16Group 24th Wed in AprilWed428/04/202127/04/202226/04/202324/04/202423/04/202522/04/202628/04/202726/04/202825/04/202924/04/203023/04/203128/04/2032444
17Group 33rd Tue in MayTue318/05/202117/05/202216/05/202321/05/202420/05/202519/05/202618/05/202716/05/202815/05/202921/05/203020/05/203118/05/2032533
18Group 41st Monday in JuneMon107/06/202106/06/202205/06/202303/06/202402/06/202501/06/202607/06/202705/06/202804/06/202903/06/203002/06/203107/06/2032612
19Group 12nd Mon in JuneMon214/06/202113/06/202212/06/202310/06/202409/06/202508/06/202614/06/202712/06/202811/06/202910/06/203009/06/203114/06/2032622
20Group 24th Thur in JuneThu424/06/202123/06/202222/06/202327/06/202426/06/202525/06/202624/06/202722/06/202828/06/202927/06/203026/06/203124/06/2032645
21Group 34th Mon in JulyMon426/07/202125/07/202224/07/202322/07/202428/07/202527/07/202626/07/202724/07/202823/07/202922/07/203028/07/203126/07/2032742
22Group 43rd Tue in SeptemberTue321/09/202120/09/202219/09/202317/09/202416/09/202515/09/202621/09/202719/09/202818/09/202917/09/203016/09/203121/09/2032933
23Group 11st Thur in SeptemberThu423/09/202122/09/202228/09/202326/09/202425/09/202524/09/202623/09/202728/09/202827/09/202926/09/203025/09/203123/09/2032945
24Group 24th Thur in SeptemberThu423/09/202122/09/202228/09/202326/09/202425/09/202524/09/202623/09/202728/09/202827/09/202926/09/203025/09/203123/09/2032945
25Group 31st Thur in OctoberThu107/10/202106/10/202205/10/202303/10/202402/10/202501/10/202607/10/202705/10/202804/10/202903/10/203002/10/203107/10/20321015
26Group 44th Wed in OctoberWed427/10/202126/10/202225/10/202323/10/202422/10/202528/10/202627/10/202725/10/202824/10/202923/10/203022/10/203127/10/20321044
27Group 11st Wed in DecemberWed101/12/202107/12/202206/12/202304/12/202403/12/202502/12/202601/12/202706/12/202805/12/202904/12/203003/12/203101/12/20321214
28Group 22nd Wed in DecemberWed208/12/202114/12/202213/12/202311/12/202410/12/202509/12/202608/12/202713/12/202812/12/202911/12/203010/12/203108/12/20321224
Sheet1
Cell Formulas
RangeFormula
C7:C28C7=TEXT(WEEKDAY(E7), "ddd")
D7:D28D7=INT((DAY(E7)-1)/7)+1
E7:P28E7=DATE(E$6,$Q7,1+7*$R7)-WEEKDAY(DATE(E$6,$Q7,8-$S7))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E7:P29,E32:P32Expression=AND(E7>TODAY(),E7<=(TODAY()+30))textNO
Cells with Data Validation
CellAllowCriteria
Q7:Q29List1,2,3,4,5,6,7,8,9,10,11,12
R7:R29List1,2,3,4,5
S7:S29List1,2,3,4,5,6,7



What I would like to happen
a) For each date(s) that are highlighted in, say yellow, for their respective group name/meeting on/day/week to also be highlighted in yellow.
b) Obviously, and going forward, when 'todays' date +30 days, in Col E to P (eventually changes the respective rows in columns A thru D will also change

Example 1: So if "todays" date +30 (days) is 01/01/2022 then A37 to D37 and F37 cells should all be yellow only.
Example 2: So if "todays" date +30 (days) is 01/03/2023 then A41 to D41 and G41 to G43 cells will all be yellow only.
and so on...

SS Meetings Example v0.4.xlsx
ABCDEFGHIJKLMNOPQRST
36Group NameMeeting onDayWeek202120222023202420252026202720282029203020312032Month No.Occurance in MonthDay No. in Week
37Group 1 (example 1)3rd Tue in JanuaryTue319/01/202118/01/202217/01/202316/01/202421/01/202520/01/202619/01/202718/01/202816/01/202915/01/203021/01/203120/01/2032133
38Group 21st Thur in FebruaryThu104/02/202103/02/202202/02/202301/02/202406/02/202505/02/202604/02/202703/02/202801/02/202907/02/203006/02/203105/02/2032215
39Group 33rd Tue in FebruaryTue316/02/202115/02/202221/02/202320/02/202418/02/202517/02/202616/02/202715/02/202820/02/202919/02/203018/02/203117/02/2032233
40Group 44th Wed in FebruaryWed424/02/202123/02/202222/02/202328/02/202426/02/202525/02/202624/02/202723/02/202828/02/202927/02/203026/02/203125/02/2032244
41Group 1 (example 2)1st Mon in MarchMon101/03/202107/03/202206/03/202304/03/202403/03/202502/03/202601/03/202706/03/202805/03/202904/03/203003/03/203101/03/2032312
42Group 2 (example 2)1st Thur in MarchThu104/03/202103/03/202202/03/202307/03/202406/03/202505/03/202604/03/202702/03/202801/03/202907/03/203006/03/203104/03/2032315
43Group 3 (example 2)3rd Tue in MarchTue316/03/202115/03/202221/03/202319/03/202418/03/202517/03/202616/03/202721/03/202820/03/202919/03/203018/03/203116/03/2032333
44Group 42nd Thur AprilThu208/04/202114/04/202213/04/202311/04/202410/04/202509/04/202608/04/202713/04/202812/04/202911/04/203010/04/203108/04/2032425
45Group 13rd Thu in AprilThu315/04/202121/04/202220/04/202318/04/202417/04/202516/04/202615/04/202720/04/202819/04/202918/04/203017/04/203115/04/2032435
46Group 24th Wed in AprilWed428/04/202127/04/202226/04/202324/04/202423/04/202522/04/202628/04/202726/04/202825/04/202924/04/203023/04/203128/04/2032444
47Group 33rd Tue in MayTue318/05/202117/05/202216/05/202321/05/202420/05/202519/05/202618/05/202716/05/202815/05/202921/05/203020/05/203118/05/2032533
48Group 41st Monday in JuneMon107/06/202106/06/202205/06/202303/06/202402/06/202501/06/202607/06/202705/06/202804/06/202903/06/203002/06/203107/06/2032612
49Group 12nd Mon in JuneMon214/06/202113/06/202212/06/202310/06/202409/06/202508/06/202614/06/202712/06/202811/06/202910/06/203009/06/203114/06/2032622
50Group 24th Thur in JuneThu424/06/202123/06/202222/06/202327/06/202426/06/202525/06/202624/06/202722/06/202828/06/202927/06/203026/06/203124/06/2032645
51Group 34th Mon in JulyMon426/07/202125/07/202224/07/202322/07/202428/07/202527/07/202626/07/202724/07/202823/07/202922/07/203028/07/203126/07/2032742
52Group 43rd Tue in SeptemberTue321/09/202120/09/202219/09/202317/09/202416/09/202515/09/202621/09/202719/09/202818/09/202917/09/203016/09/203121/09/2032933
53Group 11st Thur in SeptemberThu423/09/202122/09/202228/09/202326/09/202425/09/202524/09/202623/09/202728/09/202827/09/202926/09/203025/09/203123/09/2032945
54Group 24th Thur in SeptemberThu423/09/202122/09/202228/09/202326/09/202425/09/202524/09/202623/09/202728/09/202827/09/202926/09/203025/09/203123/09/2032945
55Group 31st Thur in OctoberThu107/10/202106/10/202205/10/202303/10/202402/10/202501/10/202607/10/202705/10/202804/10/202903/10/203002/10/203107/10/20321015
56Group 44th Wed in OctoberWed427/10/202126/10/202225/10/202323/10/202422/10/202528/10/202627/10/202725/10/202824/10/202923/10/203022/10/203127/10/20321044
57Group 11st Wed in DecemberWed101/12/202107/12/202206/12/202304/12/202403/12/202502/12/202601/12/202706/12/202805/12/202904/12/203003/12/203101/12/20321214
58Group 22nd Wed in DecemberWed208/12/202114/12/202213/12/202311/12/202410/12/202509/12/202608/12/202713/12/202812/12/202911/12/203010/12/203108/12/20321224
Sheet1
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Toadstool

Well-known Member
Joined
Mar 5, 2018
Messages
1,913
Office Version
  1. 2016
Platform
  1. Windows
Hi Manexcel,

You can't check a cell colour using a Function but you could just reuse your existing formula and use MATCH.

Manexcel.xlsx
ABCDEFGHIJKLMNOPQRS
6Group NameMeeting onDayWeek202120222023202420252026202720282029203020312032Month No.Occurance in MonthDay No. in Week
7Group 13rd Tue in JanuaryTue31/19/20211/18/20221/17/20231/16/20241/21/20251/20/20261/19/20271/18/20281/16/20291/15/20301/21/20311/20/2032133
8Group 21st Thur in FebruaryThu12/4/20212/3/20222/2/20232/1/20242/6/20252/5/20262/4/20272/3/20282/1/20292/7/20302/6/20312/5/2032215
9Group 33rd Tue in FebruaryTue32/16/20212/15/20222/21/20232/20/20242/18/20252/17/20262/16/20272/15/20282/20/20292/19/20302/18/20312/17/2032233
10Group 44th Wed in FebruaryWed42/24/20212/23/20222/22/20232/28/20242/26/20252/25/20262/24/20272/23/20282/28/20292/27/20302/26/20312/25/2032244
11Group 11st Mon in MarchMon13/1/20213/7/20223/6/20233/4/20243/3/20253/2/20263/1/20273/6/20283/5/20293/4/20303/3/20313/1/2032312
12Group 21st Thur in MarchThu13/4/20213/3/20223/2/20233/7/20243/6/20253/5/20263/4/20273/2/20283/1/20293/7/20303/6/20313/4/2032315
13Group 33rd Tue in MarchTue33/16/20213/15/20223/21/20233/19/20243/18/20253/17/20263/16/20273/21/20283/20/20293/19/20303/18/20313/16/2032333
14Group 42nd Thur AprilThu24/8/20214/14/20224/13/20234/11/20244/10/20254/9/20264/8/20274/13/20284/12/20294/11/20304/10/20314/8/2032425
15Group 13rd Thu in AprilThu34/15/20214/21/20224/20/20234/18/20244/17/20254/16/20264/15/20274/20/20284/19/20294/18/20304/17/20314/15/2032435
16Group 24th Wed in AprilWed44/28/20214/27/20224/26/20234/24/20244/23/20254/22/20264/28/20274/26/20284/25/20294/24/20304/23/20314/28/2032444
17Group 33rd Tue in MayTue35/18/20215/17/20225/16/20235/21/20245/20/20255/19/20265/18/20275/16/20285/15/20295/21/20305/20/20315/18/2032533
18Group 41st Monday in JuneMon16/7/20216/6/20226/5/20236/3/20246/2/20256/1/20266/7/20276/5/20286/4/20296/3/20306/2/20316/7/2032612
19Group 12nd Mon in JuneMon26/14/20216/13/20226/12/20236/10/20246/9/20256/8/20266/14/20276/12/20286/11/20296/10/20306/9/20316/14/2032622
20Group 24th Thur in JuneThu46/24/20216/23/20226/22/20236/27/20246/26/20256/25/20266/24/20276/22/20286/28/20296/27/20306/26/20316/24/2032645
21Group 34th Mon in JulyMon47/26/20217/25/20227/24/20237/22/20247/28/20257/27/20267/26/20277/24/20287/23/20297/22/20307/28/20317/26/2032742
22Group 43rd Tue in SeptemberTue39/21/20219/20/20229/19/20239/17/20249/16/20259/15/20269/21/20279/19/20289/18/20299/17/20309/16/20319/21/2032933
23Group 11st Thur in SeptemberThu49/23/20219/22/20229/28/20239/26/20249/25/20259/24/20269/23/20279/28/20289/27/20299/26/20309/25/20319/23/2032945
24Group 24th Thur in SeptemberThu49/23/20219/22/20229/28/20239/26/20249/25/20259/24/20269/23/20279/28/20289/27/20299/26/20309/25/20319/23/2032945
25Group 31st Thur in OctoberThu110/7/202110/6/202210/5/202310/3/202410/2/202510/1/202610/7/202710/5/202810/4/202910/3/203010/2/203110/7/20321015
26Group 44th Wed in OctoberWed410/27/202110/26/202210/25/202310/23/202410/22/202510/28/202610/27/202710/25/202810/24/202910/23/203010/22/203110/27/20321044
27Group 11st Wed in DecemberWed112/1/202112/7/202212/6/202312/4/202412/3/202512/2/202612/1/202712/6/202812/5/202912/4/203012/3/203112/1/20321214
28Group 22nd Wed in DecemberWed212/8/202112/14/202212/13/202312/11/202412/10/202512/9/202612/8/202712/13/202812/12/202912/11/203012/10/203112/8/20321224
29
Sheet1
Cell Formulas
RangeFormula
C7:C28C7=TEXT(WEEKDAY(E7), "ddd")
D7:D28D7=INT((DAY(E7)-1)/7)+1
E7:P28E7=DATE(E$6,$Q7,1+7*$R7)-WEEKDAY(DATE(E$6,$Q7,8-$S7))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A7:D32Expression=MATCH(1,($E7:$P7>TODAY())*($E7:$P7<=(TODAY()+30)),0)textNO
E7:P28Expression=AND(E7>TODAY(),E7<=(TODAY()+30))textNO
 
Solution

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
50,527
Office Version
  1. 365
Platform
  1. Windows
.. or another way to use the existing condition

Manexcel.xlsm
ABCD
6Group NameMeeting onDayWeek
7Group 13rd Tue in JanuaryTue3
8Group 21st Thur in FebruaryThu1
9Group 33rd Tue in FebruaryTue3
10Group 44th Wed in FebruaryWed4
11Group 11st Mon in MarchMon1
12Group 21st Thur in MarchThu1
13Group 33rd Tue in MarchTue3
14Group 42nd Thur AprilThu2
15Group 13rd Thu in AprilThu3
16Group 24th Wed in AprilWed4
17Group 33rd Tue in MayTue3
18Group 41st Monday in JuneMon1
19Group 12nd Mon in JuneMon2
20Group 24th Thur in JuneThu4
21Group 34th Mon in JulyMon4
22Group 43rd Tue in SeptemberTue3
23Group 11st Thur in SeptemberThu4
24Group 24th Thur in SeptemberThu4
25Group 31st Thur in OctoberThu1
26Group 44th Wed in OctoberWed4
27Group 11st Wed in DecemberWed1
28Group 22nd Wed in DecemberWed2
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A7:D28Expression=COUNTIFS($E7:$P7,">"&TODAY(),$E7:$P7,"<="&TODAY()+30)textNO
 

Toadstool

Well-known Member
Joined
Mar 5, 2018
Messages
1,913
Office Version
  1. 2016
Platform
  1. Windows
You're welcome!
Thanks for the feedback.
 

Forum statistics

Threads
1,141,073
Messages
5,704,138
Members
421,328
Latest member
mippy

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
Top