Combining Xlookup with IF and Conditional formatting

Walkon

New Member
Joined
Dec 13, 2021
Messages
29
Office Version
  1. 365
Platform
  1. Windows
My sheet contains two lists:

  • Short List: A list of 100+ person names. The list is sorted in alphabetical order by last name and is (currently) located in Column J
  • Long List: A list of the same names, each name appearing on the list five times, each time associated with a different organization. There are 60+ organizations. Each organization is a possible assignment for that person. Each person has identified five organizations they are interested in being assigned to. The list is sorted alphabetically by organization name and is (currently) located in Columns A and B
Short List:
J
Name

Mehrnaz Azziz
Terry Bush
Kyle Calso
Amanda Cunningham
John Doe

Long List:
A B
Name Organization

Amanda Cunningham Academy of Arts
John Doe Academy of Arts
Terry Bush Academy of Arts
Kyle Calso Allan Mackie House
Mehrnaz Azziz Allan Mackie House
Amanda Cunningham Allan Mackie House
Terry Bush Allan Mackie House
Mehrnaz Azziz Braintrust Educare

My task is to assign a single organization to each name. After each name is assigned an organization, a separate formula places an “x” in column K.

Short List
J K
Name Assigned

Mehrnaz Azziz
Terry Bush x
Kyle Calso
Amanda Cunningham x
John Doe

As there are more Names than Organizations, there are several names listed for each Organization.

To reduce clutter and confusion, after each person’s assignment has been made, I would like to use Conditional Formatting to Strikethrough every instance of that name on the Long List. Since each name is only assigned once, after they are assigned, there is no reason for their names to remain on the list. It doesn't matter which organization they are assigned to, simply that they are assigned.

A B
Name Organization

Amanda Cunningham Academy of Arts
John Doe Academy of Arts
Terry Bush Academy of Arts
Kyle Calso Allan Mackie House
Mehrnaz Azziz Allan Mackie House
Amanda Cunningham Allan Mackie House
Terry Bush Allan Mackie House
Mehrnaz Azziz Braintrust Educare

My idea is to use the IF function to determine if there is an “x” in column K beside a name in column J and if there is, to use Xlookup to find each instance of that name in column A and use Conditional Formatting to place the Strikethrough format on each instance.

I have been unable to create a formula(s) to accomplish this and am not even sure if it is possible. I look forward to the knowledge and ideas of others.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Welcome to the MrExcel board!

I suggest that you investigate XL2BB for providing sample data & expected results to make it easier for helpers to understand just what you have & where it is and also what you want & where it is to be.

Conditional Formatting like this?

Walkon.xlsm
ABJK
1NameOrganizationName
2Amanda CunninghamAcademy of ArtsMehrnaz Azziz
3John DoeAcademy of ArtsTerry Bushx
4Terry BushAcademy of ArtsKyle Calso
5Kyle CalsoAllan Mackie HouseAmanda Cunninghamx
6Mehrnaz AzzizAllan Mackie HouseJohn Doe
7Amanda CunninghamAllan Mackie House
8Terry BushAllan Mackie House
9Mehrnaz AzzizBraintrust Educare
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A9Expression=XLOOKUP(A2,J$2:J$6,K$2:K$6)="x"textNO
 
Upvote 0
Solution
Welcome to the MrExcel board!

I suggest that you investigate XL2BB for providing sample data & expected results to make it easier for helpers to understand just what you have & where it is and also what you want & where it is to be.

Conditional Formatting like this?

Walkon.xlsm
ABJK
1NameOrganizationName
2Amanda CunninghamAcademy of ArtsMehrnaz Azziz
3John DoeAcademy of ArtsTerry Bushx
4Terry BushAcademy of ArtsKyle Calso
5Kyle CalsoAllan Mackie HouseAmanda Cunninghamx
6Mehrnaz AzzizAllan Mackie HouseJohn Doe
7Amanda CunninghamAllan Mackie House
8Terry BushAllan Mackie House
9Mehrnaz AzzizBraintrust Educare
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A9Expression=XLOOKUP(A2,J$2:J$6,K$2:K$6)="x"textNO
Good morning Peter,

Thank-you very much for your welcome and quick reply. The formula you supplied seems to partialy work. I very much appreciate it. I am rushed for time currently, but will take a closer look and explain what is occurring.

Thnkas again,

Rob
 
Upvote 0
Welcome to the MrExcel board!

I suggest that you investigate XL2BB for providing sample data & expected results to make it easier for helpers to understand just what you have & where it is and also what you want & where it is to be.

Conditional Formatting like this?

Walkon.xlsm
ABJK
1NameOrganizationName
2Amanda CunninghamAcademy of ArtsMehrnaz Azziz
3John DoeAcademy of ArtsTerry Bushx
4Terry BushAcademy of ArtsKyle Calso
5Kyle CalsoAllan Mackie HouseAmanda Cunninghamx
6Mehrnaz AzzizAllan Mackie HouseJohn Doe
7Amanda CunninghamAllan Mackie House
8Terry BushAllan Mackie House
9Mehrnaz AzzizBraintrust Educare
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A9Expression=XLOOKUP(A2,J$2:J$6,K$2:K$6)="x"textNO
 
Upvote 0
Welcome to the MrExcel board!

I suggest that you investigate XL2BB for providing sample data & expected results to make it easier for helpers to understand just what you have & where it is and also what you want & where it is to be.

Conditional Formatting like this?

Walkon.xlsm
ABJK
1NameOrganizationName
2Amanda CunninghamAcademy of ArtsMehrnaz Azziz
3John DoeAcademy of ArtsTerry Bushx
4Terry BushAcademy of ArtsKyle Calso
5Kyle CalsoAllan Mackie HouseAmanda Cunninghamx
6Mehrnaz AzzizAllan Mackie HouseJohn Doe
7Amanda CunninghamAllan Mackie House
8Terry BushAllan Mackie House
9Mehrnaz AzzizBraintrust Educare
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A9Expression=XLOOKUP(A2,J$2:J$6,K$2:K$6)="x"textNO

Good morning again Peter,

Thank-you again for your assistance. The XL2BB seems like a wonderful tool. I am trying it below for the first time. In brief, I inserted the formula you suggested and it partially worked. As (hopefully) seen below, 1) it appears to have stopped working for all at row 110 - this corresponds to the end of the list of names. 2) It worked for some names above that row (see Amanda Moore, lines 29, 444, 55, 86) and for some instances of some names above that row (see Courtney Somers, lines 2 and 65; Kacey Wemyss, lines 21 and 27). So I am not sure what I am doing wrong. I look forward to any advice you may be able to provide.

Walkon.xlsm
ABJK
1NameOrganizationName
2Amanda CunninghamAcademy of ArtsMehrnaz Azziz
3John DoeAcademy of ArtsTerry Bushx
4Terry BushAcademy of ArtsKyle Calso
5Kyle CalsoAllan Mackie HouseAmanda Cunninghamx
6Mehrnaz AzzizAllan Mackie HouseJohn Doe
7Amanda CunninghamAllan Mackie House
8Terry BushAllan Mackie House
9Mehrnaz AzzizBraintrust Educare
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A9Expression=XLOOKUP(A2,J$2:J$6,K$2:K$6)="x"textNO
 
Upvote 0
As (hopefully) seen below, 1) it appears to have stopped working for all at row 110 - this corresponds to the end of the list of names. 2) It worked for some names above that row (see Amanda Moore, lines 29, 444, 55, 86) and for some instances of some names above that row (see Courtney Somers, lines 2 and 65; Kacey Wemyss, lines 21 and 27).
Unfortunately, what was below was my mini-sheet, not yours. The rest of your description doesn't mean much without being able to see your mini-sheet.

XL2BB does not readily show Strikethrough that is applied through Conditional Formatting (I had to trick it to do that above) so if you are trying to show us what is happening, I suggest that for the moment you apply Bold font in the CF rather than Strikethrough.
 
Upvote 0
Unfortunately, what was below was my mini-sheet, not yours. The rest of your description doesn't mean much without being able to see your mini-sheet.

XL2BB does not readily show Strikethrough that is applied through Conditional Formatting (I had to trick it to do that above) so if you are trying to show us what is happening, I suggest that for the moment you apply Bold font in the CF rather than Strikethrough.
Hi Peter,
Thank-you for your patience. I'll try this again
Mrexcel sheet.xlsx
ABJK
1FullNameOrganizationFull NamePlaced x
2Courtney SomersAcademy of Inquiry and Adventure OkanaganNelli Acejox
3Kevin AndersonAcademy of Inquiry and Adventure OkanaganAlexis Allshornx
4Cassidy AshmanAcademy of Inquiry and Adventure OkanaganKevin Andersonx
5Danika LiefkeAcademy of Inquiry and Adventure OkanaganAriane Arbourx
6Bilal MadaniAcademy of Inquiry and Adventure OkanaganCassidy Ashmanx
7Kyle SobonAcademy of Inquiry and Adventure OkanaganBrennan Atamanchukx
8Grayson BallAcademy of Inquiry and Adventure OkanaganGrayson Ballx
9Hannah CalsoAcademy of Inquiry and Adventure OkanaganLuisa Bergerx
10Cassidy ScottAcademy of Inquiry and Adventure OkanaganMegan Bernardx
11Blair VisscherAcademy of Inquiry and Adventure OkanaganJulie Bertlesx
12Emma ZarnkeAcademy of Inquiry and Adventure OkanaganLuke Bertoluccix
13Hannah CalsoAllan Brooks Nature CentreNicolas Brengarthx
14Domenic SmithAllan Brooks Nature CentreSarah Brownx
15Julie BertlesAllan Brooks Nature CentreMarcus Bucekx
16Jenae DrisnerAllan Brooks Nature CentreChloe Burak-Baxterx
17Danika LiefkeAllan Brooks Nature CentreHannah Calsox
18Rylee RobinsonAllan Brooks Nature CentreSelena Clarkx
19Jakob HamiltonAllan Brooks Nature CentreMehrnaz Coady Kobarix
20Jennifer KemperAllan Brooks Nature CentreClaudia Corneilx
21Kacey WemyssAllan Brooks Nature CentreSteven Cresswellx
22Bilal MadaniAllan Brooks Nature CentreKendel Cunninghamx
23Kendel CunninghamBalsam SchoolLena Danylukx
24Helen Elyse JohnstonBalsam SchoolJenae Drisnerx
25Emma MiddletonBalsam SchoolKelly Duckworthx
26Kristen NaultBalsam SchoolKelsi Edgelowx
27Kacey WemyssBalsam SchoolJohn Eekx
28Jakob HamiltonBalsam SchoolJyllian Enosx
29Amanda MooreBalsam SchoolLoran Evansx
30Sidney NesbittBalsam SchoolNathan Forestellx
31Laura SchellenbergBalsam SchoolDierdre Forrestx
32Cassidy AshmanBalsam SchoolKendyl Fosterx
33Megan BernardBalsam SchoolMackenna Gallowayx
34Luke BertolucciBalsam SchoolKendra Halldingx
35Jessica HemrichBalsam SchoolJakob Hamiltonx
36Bilal MadaniBalsam SchoolDan Hex
37Maya PetersonBalsam SchoolJessica Hemrichx
38Whitney SigstonBalsam SchoolBaylee Hopwox
39Vincent TimmermansBalsam SchoolGemma Howardx
40Angelina VeltriBalsam SchoolElyse Johnstonx
41Luisa BergerBalsam SchoolJennifer Kemperx
42Steven CresswellBalsam SchoolTatyjania Khounvisethx
43Amanda KingBalsam SchoolAmanda Kingx
44Amanda MooreBalsam SchoolAlyssa Koziolx
45Evan TelfordBalsam SchoolJaymie Kwiatkowskix
46Chloe WorrallBalsam SchoolNicole Labrecquex
47Jenae DrisnerBalsam SchoolJoshua Landiex
48Loran EvansBalsam SchoolNoelle Lavalleex
49Jaymie KwiatkowskiBalsam SchoolMia Leckyx
50Mikayla PodmorowBalsam SchoolMcKenna Lesiukx
51Camille Rivard-SiroisBalsam SchoolJessica Lewisx
52Kristen TennantBalsam SchoolDanika Liefkex
53Noni PhillipsBGC OkanaganKaitlin MacLeod Rogersx
54Baylee HopwoBGC OkanaganBilal Madanix
55Amanda MooreBGC OkanaganJesse Mannax
56Grayson BallBraintrust CanadaKatrina Martelx
57Baylee HopwoBraintrust CanadaEmily McCormickx
58Sidney NesbittBraintrust CanadaJessica McIntyrex
59Cassidy ScottBraintrust CanadaChristoph Messerer-Trosinx
60Jessica LewisBraintrust CanadaEmma Middletonx
61Callie MillerBraintrust CanadaCallie Millerx
62Taylor PilonBraintrust CanadaAmanda Moorex
63Coral RuttanBraintrust CanadaKristen Naultx
64Christoph Messerer-TrosinBraintrust CanadaSidney Nesbittx
65Courtney SomersBraintrust CanadaKim Neville-Rutherfordx
66Carolane NormandeauBuilding Blocks EducareCarolane Normandeaux
67Sydney RomanchukBuilding Blocks EducareEmily Nottinghamx
68Anastazia ZirosBuilding Blocks EducareAlly Perryx
69Megan BernardBuilding Blocks EducareMaya Petersonx
70Jessica HemrichBuilding Blocks EducareNoni Phillipsx
71Jessica McIntyreBuilding Blocks EducareTaylor Pilonx
72Claire TaylorBuilding Blocks EducareMikayla Podmorowx
73Angelina VeltriBuilding Blocks EducareJulia Pokropp-Motschkox
74Mia LeckyBuilding Blocks EducareRyley Pricex
75Sidney NesbittBuilding Blocks EducareIsabela Richardx
76Danika LiefkeCaetani Cultural CentreNicole Richardsonx
77Julie BertlesCaetani Cultural CentreCamille Rivard-Siroisx
78Isabela RichardCentral Programs and ServicesRylee Robinsonx
79Anastazia ZirosCentral Programs and ServicesSydney Romanchukx
80NELLI KIM AcejoCentral Programs and ServicesMhari Runcimanx
81Kelsi EdgelowCentral Programs and ServicesJosh Russellx
82Jesse MannaCentral Programs and ServicesCoral Ruttanx
83Serena SlonowskiCentral Programs and ServicesJessica Sandersx
84Jeffrey TookeyCentral Programs and ServicesLaura Schellenbergx
85Claudia CorneilCentral Programs and ServicesCassidy Scottx
86Amanda MooreCentral Programs and ServicesWhitney Sigstonx
87Samantha SkinnerCentral Programs and ServicesAmanda Singerx
88Cassidy ScottCentral Programs and ServicesSamantha Skinnerx
89Danielle TompkinsCentral Programs and ServicesSerena Slonowskix
90Luke BertolucciCentral Programs and ServicesDomenic Smithx
91Selena ClarkCentre culturel francophone de l'OkanaganKyle Sobonx
92Julia Pokropp-MotschkoCentre culturel francophone de l'OkanaganCourtney Somersx
93Samantha TemmeCentre culturel francophone de l'OkanaganClaire Taylorx
94Mhari RuncimanCentre culturel francophone de l'OkanaganLeah Taylorx
95Nathan ForestellCentre culturel francophone de l'OkanaganEvan Telfordx
96Rylee RobinsonClubhouse - Treehouse Forest PreschoolSam Temmex
97Jade ZitkoClubhouse - Treehouse Forest PreschoolKristen Tennantx
98Noelle LavalleeClubhouse - Treehouse Forest PreschoolVincent Timmermansx
99Maya PetersonClubhouse - Treehouse Forest PreschoolDanielle Tompkinsx
100Leah TaylorClubhouse - Treehouse Forest PreschoolJeffrey Tookeyx
101Emma MiddletonClubhouse - Treehouse Forest PreschoolMichael Vaskox
102Kim Neville-RutherfordClubhouse - Treehouse Forest PreschoolAngelina Veltrix
103Chloe WorrallClubhouse - Treehouse Forest PreschoolBlair Visscherx
104Sidney NesbittClubhouse - Treehouse Forest PreschoolKacey Wemyssx
105Kristen TennantClubhouse - Treehouse Forest PreschoolAmy Williamsx
106Chloe Burak-BaxterClubhouse - Treehouse Forest PreschoolStephen Wilsonx
107Gemma HowardClubhouse - Treehouse Forest PreschoolChloe Worrallx
108Jessica McIntyreClubhouse - Treehouse Forest PreschoolEmma Zarnkex
109Carolane NormandeauClubhouse - Treehouse Forest PreschoolAnastazia Zirosx
110Jenae DrisnerClubhouse Child Care SutherlandJade Zitkox
111Sydney RomanchukClubhouse Child Care Sutherland
112Leah TaylorClubhouse Child Care Sutherland
113Chloe WorrallClubhouse Child Care Sutherland
114Jessica McIntyreClubhouse Childcare Cottonwoods
115Sydney RomanchukClubhouse Childcare Cottonwoods
116Coral RuttanClubhouse Childcare Cottonwoods
117Megan BernardClubhouse Farm
118Jenae DrisnerClubhouse Farm
119Noelle LavalleeClubhouse Farm
120Mia LeckyClubhouse Farm
121Kim Neville-RutherfordClubhouse Farm
122Maya PetersonClubhouse Farm
123Laura SchellenbergClubhouse Farm
124Chloe WorrallClubhouse Farm
125Luisa BergerClubhouse Farm
126Helen Elyse JohnstonClubhouse Farm
127Jaymie KwiatkowskiClubhouse Farm
128Emma MiddletonClubhouse Farm
129Evan TelfordClubhouse Farm
130Vincent TimmermansClubhouse Farm
131Emma ZarnkeClubhouse Farm
132Amanda MooreClubhouse Farm
133Jessica SandersClubhouse Farm
134Kristen TennantClubhouse Farm
135Cassidy AshmanClubhouse Farm
136Kendra HalldingClubhouse Farm
137Gemma HowardClubhouse Farm
138Tatyjania KhounvisethClubhouse Farm
139McKenna LesiukClubhouse Farm
140Danika LiefkeClubhouse Farm
141Amanda MooreClubhouse Farm
142Rylee RobinsonClubhouse Farm
143Samantha SkinnerClubhouse Farm
144Michael VaskoClubhouse Farm
145Kelsi EdgelowColumbia Outdoor School & Blue Lake Camp
146Amanda KingColumbia Outdoor School & Blue Lake Camp
147Kristen NaultColumbia Outdoor School & Blue Lake Camp
148Emily NottinghamColumbia Outdoor School & Blue Lake Camp
149Luisa BergerColumbia Outdoor School & Blue Lake Camp
150Chloe Burak-BaxterColumbia Outdoor School & Blue Lake Camp
Org by rank (3)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A110Expression=XLOOKUP(A1048575,J$2:J$110,K$2:K$110)="x"textNO
 
Upvote 0
You have applied the Conditional Formatting incorrectly. You can see that from this

1639712599863.png


Select the whole of column A and then Conditional Formatting -> Clear Rules -> Clear Rules from Selected Cells

Now select from A2 down to the bottom of your column A data or as far as that column A data might ever go, but the active cell should be A2
Now apply the CF with rule

=XLOOKUP(A2,J$2:J$110,K$2:K$110="x"
 
Upvote 0
You have applied the Conditional Formatting incorrectly. You can see that from this

View attachment 53566

Select the whole of column A and then Conditional Formatting -> Clear Rules -> Clear Rules from Selected Cells

Now select from A2 down to the bottom of your column A data or as far as that column A data might ever go, but the active cell should be A2
Now apply the CF with rule

=XLOOKUP(A2,J$2:J$110,K$2:K$110="x"
Good morning Peter,

Thank-you very much for your patience and persistence. I have no idea how I entered A1048575 instead of A2, but at any rate the formula works perfectly now. I did notice that I have some data inconsistencies (double spaces beween given name and surname, etc.) so was able to clear them up. This formula has greatly improved by spreadsheet and will save me lots of time in the future, that-you again for your assistance.

Best,

Rob
 
Upvote 0
I have no idea how I entered A1048575
You would not have actually typed that value. It would relate to what you had selected and what the active cell was when you entered the CF rule and/or how you entered the CF for a cell or range of cells and then perhaps copied the format to a different or larger range.

In any case, it doesn't really matter so long as you have it sorted now. :)
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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