Conditional Formatting based on certain values within cells

furnitureguy1

New Member
Joined
May 3, 2013
Messages
6
Hello, I have an employee vacation worksheet where I need cells to become highlighted if two or more people in the same group are taking the same days off. One cell may contain 1,2,3,4 and the other may contain only 3...but since they both share the number 4 I need them both to highlight red. I have diagrammed what I am talking about below.

Thank you in advance for your help!

Randy1,2,3,4
John
Beth3
Billy5
Dan

<tbody>
</tbody>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I think that a situation like this is where PowerQuery really shines, if you have it available. This doesn't do any highlighting, but it does put it into a pivot table where you can easily see who has what days off, and more importantly, who has the same day off. Here are the steps.

Select your data and on the 'Data' tab under 'Get & Transform' click 'From Table'.

Then in the editor, follow these steps.

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.SplitColumn(Table.TransformColumnTypes(Source, {{"Days", type text}}, "en-US"), "Days", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Days.1", "Days.2", "Days.3", "Days.4"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Days.1", Int64.Type}, {"Days.2", Int64.Type}, {"Days.3", Int64.Type}, {"Days.4", Int64.Type}}),
    #"Unpivoted Only Selected Columns" = Table.Unpivot(#"Changed Type", {"Days.1", "Days.2", "Days.3", "Days.4"}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Only Selected Columns",{"Attribute"})
in
    #"Removed Columns"


In the editor, under the 'Home' tab, click 'Close and Load To' and select 'Only Create Connection' and select 'Add to Data Model'.

Then, under the 'Data' tab, select 'Manage Data Model', and select 'Pivot Table'.

At that point it works just like any other Pivot Table and you can get the results below.

I know it seems like a lot of steps, but once you play around with PowerQuery, it is actually really easy.









ABCDE
1NameDaysDayName
2Randy1,2,3,41Randy
3John2Randy
4Beth33Beth
5Billy5Randy
6Dan4Randy
75Billy

<caption>LEGO HTML</caption><colgroup><col style="width: 54px"><col width="124"><col width="124"><col width="124"><col width="145"><col width="121"></colgroup><tbody>
</tbody>
 
Upvote 0
Thank you Irobbo, but unfortunately this option won't really help me for the sheer fact that I would have to change the information in the editor over 200 times (52 weeks x 4 teams). My mistake for not posting a larger sample size of what I have, but as you can see the way it is currently being used, the numbers aren't always going to be 1-5 or even 1-31, it is separated by weeks. Sorry again for the confusion.

Employee NameJuneJuneJuneJuneJuly
4-811-1518-2225-292-6
Randy4,5,6204
John1125,26,27
Beth527,28,29
Billy18,19,204,5

<tbody>
</tbody>
 
Upvote 0
Works essentially the same way. The only change I made to your original data was to include row 2 with row 1 as you can see in the table below. There are a couple extra steps in the editor, but the whole thing only took a couple of minutes to put together. If you're interested in this approach, let me know and I will try to walk you through it. Otherwise, I would imagine that conditional formatting won't be able to handle it. Probably would need to use VBA.
<table valign="top" border="1"><caption>LEGO HTML</caption><col width="54"><col width="169"><col width="131"><col width="141"><col width="141"><col width="141"><col width="127"><col width="124"><col width="145"><col width="124"><col width="170">
<tr><td></td><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">A</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">B</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">C</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">D</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">E</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">F</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">G</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">H</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">I</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">J</font></th></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">1</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Employee Name</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">June 4-8</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">June 11-15</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">June 18-22</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">June 25-29</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">July 2-6</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(91, 155, 213)"><font face="Calibri" style="color:rgb(255, 255, 255)">Date Range</font></td><td style="background-color:rgb(91, 155, 213)"><font face="Calibri" style="color:rgb(255, 255, 255)">Day</font></td><td style="background-color:rgb(91, 155, 213)"><font face="Calibri" style="color:rgb(255, 255, 255)">Employee Name</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">2</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Randy</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">4,5,6</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">20</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)">July 2-6</font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Billy</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">3</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">John</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">11</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">25,26,27</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Randy</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">4</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Beth</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">5</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">27,28,29</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">5</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Billy</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">5</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Billy</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">18,19,20</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">4,5</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)">June 11-15</font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">11</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">John</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">6</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)">June 18-22</font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">18</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Billy</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">7</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">19</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Billy</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">8</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">20</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Billy</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">9</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Randy</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">10</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)">June 25-29</font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">25</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">John</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">11</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">26</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">John</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">12</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">27</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Beth</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">13</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">John</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">14</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">28</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Beth</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">15</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">29</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Beth</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">16</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)">June 4-8</font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Randy</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">17</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">5</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Beth</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">18</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Randy</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">19</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(155, 194, 230)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(189, 215, 238)"><font face="Calibri" style="color:rgb(0, 0, 0)">6</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Randy</font></td></tr></table>
 
Last edited:
Upvote 0
Speaking of a VBA solution, I think I might have one for you.

Here's the code.

Code:
Sub test()
Dim R       As Range: Set R = Range("B3:F" & Range("A" & Rows.Count).End(xlUp).Row)
Dim Col     As Range: Set Col = R.Cells(1, 1)
Dim D1      As New Dictionary
Dim D2      As New Dictionary
Dim SP1()   As String
Dim SP2()   As String
Dim Cur     As String


Set Col = Col.Resize(R.Rows.Count, 1)


For c = 1 To R.Columns.Count
    For i = 1 To Col.Rows.Count
        Cur = Col.Cells(i, 1).Address
        SP1 = Split(Col.Cells(i, 1), ",")
        Add2Dict D1, SP1
        If UBound(SP1) > -1 Then
            For j = 1 To Col.Rows.Count
                If Cur <> Col.Cells(j).Address Then
                    SP2 = Split(Col.Cells(j), ",")
                    If UBound(SP2) > -1 Then
                        Add2Dict D2, SP2
                        If Compare(D1, D2) Then
                            Col.Cells(j).Interior.ColorIndex = 6
                        End If
                    End If
                End If
            Next j
        End If
        ClearDict D1
        ClearDict D2
    Next i
    Set Col = Col.Offset(, 1)
Next c


End Sub


Sub Add2Dict(D As Dictionary, AR As Variant)
For i = 0 To UBound(AR)
    D.Add AR(i), AR(i)
Next i
End Sub


Sub ClearDict(D As Dictionary)
D.RemoveAll
End Sub


Function Compare(D1 As Dictionary, D2 As Dictionary) As Boolean
Dim Res As Boolean: Res = False
For i = 0 To D2.Count -1
    If D1.Exists(D2.Items(i)) Then
        Res = True
        Exit For
    End If
Next i
Compare = Res
End Function

And here's what the results look like.
<table valign="top" border="1"><caption>LEGO HTML</caption><col width="54"><col width="158"><col width="108"><col width="108"><col width="119"><col width="119"><col width="108">
<tr><td></td><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">A</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">B</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">C</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">D</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">E</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">F</font></th></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">1</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>Employee Name</b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>June</b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>June</b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>June</b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>June</b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>July</b></font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">2</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b></b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>4-8</b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>11-15</b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>18-22</b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>25-29</b></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"><b>2-6</b></font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">3</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Randy</font></td><td style="background-color:rgb(255, 255, 0)"><font face="Calibri" style="color:rgb(0, 0, 0)">4,5,6</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 0)"><font face="Calibri" style="color:rgb(0, 0, 0)">20</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 0)"><font face="Calibri" style="color:rgb(0, 0, 0)">4</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">4</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">John</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">11</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 0)"><font face="Calibri" style="color:rgb(0, 0, 0)">25,26,27</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">5</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Beth</font></td><td style="background-color:rgb(255, 255, 0)"><font face="Calibri" style="color:rgb(0, 0, 0)">5</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 0)"><font face="Calibri" style="color:rgb(0, 0, 0)">27,28,29</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">6</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Billy</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 0)"><font face="Calibri" style="color:rgb(0, 0, 0)">18,19,20</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 0)"><font face="Calibri" style="color:rgb(0, 0, 0)">4,5</font></td></tr></table>
 
Last edited:
Upvote 0
Forgot to mention, you will need to add a reference to 'Microsoft Scripting Runtime'.
 
Upvote 0
Thank you again for your help! I think this is going to be the way to go, and I modified the code you sent a little bit to include the entire range that my spreadsheet entails, but I keep getting a run-time error at this point in the code. 'Run-time error 457': This key is already associated with an element of this collection. Any idea how I can fix it?

Code:
[FONT=Verdana]Sub Add2Dict(D As Dictionary, AR As Variant)[/FONT]
For i = 0 To UBound(AR)
    [COLOR=#ff0000]D.Add AR(i), AR(i)[/COLOR]
Next i
End Sub
 
Upvote 0
Change the first argument from AR(i) to just 'i'. That might work. If it doesn't, give me some sample data that's causing the error and I'll troubleshoot it.
 
Last edited:
Upvote 0
Actually, thinking about it... It's not best practices, but if you add this line at the top of the sub it'll probably work.

On error resume next
 
Upvote 0
Is there any way I could just get the file itself to you? I tried re-editing the sub as you mentioned and nothing worked. Even if I am able to get it working, the bigger problem is going to be that I need each team to operate independently. Here is a picture of part of the spreadsheet.

d7K0Az
https://ibb.co/d7K0Az
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,483
Members
448,967
Latest member
visheshkotha

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