Reference Question

%3CLINGO-SUB%20id%3D%22lingo-sub-1789038%22%20slang%3D%22en-US%22%3EReference%20Question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1789038%22%20slang%3D%22en-US%22%3E%3CP%3E%3CBR%20%2F%3EI%20am%20trying%20to%20figure%20out%20how%20to%20use%20the%20Lookup%20formulas%20in%20Excel%20to%20get%20what%20I%20need.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%202x100%20table%20of%20values.%20The%20left%20column%2C%20%22A%22%2C%20has%20a%20series%20of%20unique%20numbers.%20The%20right%20column.%20%22B%22%20has%20several%20repeated%20values%2C%20as%20many%20as%2010%20of%20each%20value%2C%20so%20not%20unique.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEX%3A%20Source%20Table%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BA%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20B%3C%2FP%3E%3CP%3E111%20Squeeze%3CBR%20%2F%3E112%20SacBnt%3C%2FP%3E%3CP%3E113%20Sneaky%3C%2FP%3E%3CP%3E114%20PulBak%3C%2FP%3E%3CP%3E115%20Bnt%26amp%3BRn%3C%2FP%3E%3CP%3E121%20Slap%3C%2FP%3E%3CP%3E122%20FakTak%3C%2FP%3E%3CP%3E123%20Take%3C%2FP%3E%3CP%3E124%20Steal%3C%2FP%3E%3CP%3E125%20Ht%26amp%3BRn%3C%2FP%3E%3CP%3E131%20Delay%3C%2FP%3E%3CP%3E132%20Cancel%3C%2FP%3E%3CP%3E133%20Repeat%3C%2FP%3E%3CP%3E134%20Squeeze%3C%2FP%3E%3CP%3E135%20SacBnt%3C%2FP%3E%3CP%3E141%20Sneaky%3C%2FP%3E%3CP%3E142%20PulBak%3C%2FP%3E%3CP%3E143%20Bnt%26amp%3BRn%3C%2FP%3E%3CP%3E144%20Slap%3C%2FP%3E%3CP%3E145%20FakTak%3C%2FP%3E%3CP%3E151%20Take%3C%2FP%3E%3CP%3E152%20Steal%3C%2FP%3E%3CP%3E153%20Ht%26amp%3BRn%3C%2FP%3E%3CP%3E154%20Delay%3C%2FP%3E%3CP%3E155%20Cancel%3C%2FP%3E%3CP%3E211%20Repeat%3C%2FP%3E%3CP%3E212%20Squeeze%3C%2FP%3E%3CP%3E213%20SacBnt%3C%2FP%3E%3CP%3E214%20Sneaky%3C%2FP%3E%3CP%3E215%20PulBak%3C%2FP%3E%3CP%3E221%20Bnt%26amp%3BRn%3C%2FP%3E%3CP%3E222%20Slap%3C%2FP%3E%3CP%3E223%20FakTak%3C%2FP%3E%3CP%3E224%20Take%3C%2FP%3E%3CP%3E225%20Steal%3C%2FP%3E%3CP%3E231%20Ht%26amp%3BRn%3C%2FP%3E%3CP%3E232%20Delay%3C%2FP%3E%3CP%3E233%20Cancel%3C%2FP%3E%3CP%3E234%20Repeat%3C%2FP%3E%3CP%3E235%20Squeeze%3C%2FP%3E%3CP%3E241%20SacBnt%3C%2FP%3E%3CP%3E242%20Sneaky%3C%2FP%3E%3CP%3E243%20PulBak%3C%2FP%3E%3CP%3E244%20Bnt%26amp%3BRn%3C%2FP%3E%3CP%3E245%20Slap%3C%2FP%3E%3CP%3E251%20FakTak%3C%2FP%3E%3CP%3E252%20Take%3C%2FP%3E%3CP%3E253%20Steal%3C%2FP%3E%3CP%3E254%20Ht%26amp%3BRn%3C%2FP%3E%3CP%3E255%20Delay%3C%2FP%3E%3CP%3E311%20DrgBnt%3C%2FP%3E%3CP%3E312%20Repeat%3C%2FP%3E%3CP%3E313%20Squeeze%3C%2FP%3E%3CP%3E314%20SacBnt%3C%2FP%3E%3CP%3E315%20Sneaky%3C%2FP%3E%3CP%3E321%20PulBak%3C%2FP%3E%3CP%3E322%20Bnt%26amp%3BRn%3C%2FP%3E%3CP%3E323%20Slap%3C%2FP%3E%3CP%3E324%20FakTak%3C%2FP%3E%3CP%3E325%20Take%3C%2FP%3E%3CP%3E331%20Steal%3C%2FP%3E%3CP%3E332%20Ht%26amp%3BRn%3C%2FP%3E%3CP%3E333%20Delay%3C%2FP%3E%3CP%3E334%20DrgBnt%3C%2FP%3E%3CP%3E335%20Repeat%3C%2FP%3E%3CP%3E341%20Squeeze%3C%2FP%3E%3CP%3E342%20SacBnt%3C%2FP%3E%3CP%3E343%20Sneaky%3C%2FP%3E%3CP%3E344%20PulBak%3C%2FP%3E%3CP%3E345%20Bnt%26amp%3BRn%3C%2FP%3E%3CP%3E351%20Slap%3C%2FP%3E%3CP%3E352%20FakTak%3C%2FP%3E%3CP%3E353%20Take%3C%2FP%3E%3CP%3E354%20Steal%3C%2FP%3E%3CP%3E355%20Ht%26amp%3BRn%3C%2FP%3E%3CP%3E411%20Delay%3C%2FP%3E%3CP%3E412%20DrgBnt%3C%2FP%3E%3CP%3E413%20Repeat%3C%2FP%3E%3CP%3E414%20Squeeze%3C%2FP%3E%3CP%3E415%20SacBnt%3C%2FP%3E%3CP%3E421%20Sneaky%3C%2FP%3E%3CP%3E422%20PulBak%3C%2FP%3E%3CP%3E423%20Bnt%26amp%3BRn%3C%2FP%3E%3CP%3E424%20Slap%3C%2FP%3E%3CP%3E425%20FakTak%3C%2FP%3E%3CP%3E431%20Take%3C%2FP%3E%3CP%3E432%20Steal%3C%2FP%3E%3CP%3E433%20Ht%26amp%3BRn%3C%2FP%3E%3CP%3E434%20Delay%3C%2FP%3E%3CP%3E435%20DrgBnt%3C%2FP%3E%3CP%3E441%20Repeat%3C%2FP%3E%3CP%3E442%20Squeeze%3C%2FP%3E%3CP%3E443%20SacBnt%3C%2FP%3E%3CP%3E444%20Sneaky%3C%2FP%3E%3CP%3E445%20PulBak%3C%2FP%3E%3CP%3E451%20Bnt%26amp%3BRn%3C%2FP%3E%3CP%3E452%20Slap%3C%2FP%3E%3CP%3E453%20FakTak%3C%2FP%3E%3CP%3E454%20Take%3C%2FP%3E%3CP%3E455%20Steal%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20a%20separate%20table%20I%20need%20to%20look%20for%20the%20lowest%20%22A%22%20value%20of%20each%20%22B%22%20value%2C%20then%20the%20next%20lowest%2C%20etc...%20So%20in%20the%20top%20row%20of%20the%20following%20table%2C%20I%20need%20the%20lowest%20%22A%22%20value%20of%20%22Take%22%20from%20the%20first%20table%2C%20which%20is%20123%2C%20then%20the%20next%20lowest%20is%20151%2C%20then%20224%2C%20etc...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEX%3A%20I%20need%20to%20end%20up%20with%20this%20table%20after%20referencing%20the%20source%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETake%20123%20151%20224%20252%20325%20353%20431%20454%3CBR%20%2F%3EFakTak%26nbsp%3B%26nbsp%3B%20122%20145%20223%20251%20324%20352%20425%20453%3CBR%20%2F%3EBnt%26amp%3BRn%20115%20143%20221%20244%20322%20345%20423%20451%3CBR%20%2F%3EDrgBnt%26nbsp%3B%26nbsp%3B%20311%20334%20412%20435%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3ESacBnt%26nbsp%3B%26nbsp%3B%20112%20135%20213%20241%20314%20342%20415%20443%3CBR%20%2F%3ESneaky%26nbsp%3B%26nbsp%3B%20113%20141%20214%20242%20315%20343%20421%20444%3CBR%20%2F%3ESqueeze%20111%20134%20212%20235%20313%20341%20414%20442%3CBR%20%2F%3EPulBak%26nbsp%3B%26nbsp%3B%20114%20142%20215%20243%20321%20344%20422%20445%3CBR%20%2F%3ESlap%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20121%20144%20222%20245%20323%20351%20424%20452%3CBR%20%2F%3EHt%26amp%3BRn%26nbsp%3B%26nbsp%3B%20125%20153%20231%20254%20332%20355%20433%3CBR%20%2F%3ESteal%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20124%20152%20225%20253%20331%20354%20432%20455%3CBR%20%2F%3EDelay%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20131%20154%20232%20255%20333%20411%20434%3CBR%20%2F%3ECancel%26nbsp%3B%26nbsp%3B%26nbsp%3B%20132%20155%20233%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3ERepeat%26nbsp%3B%26nbsp%3B%26nbsp%3B%20133%20211%20234%20312%20335%20413%20441%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20attached%20a%20file%20with%20the%20source%20and%20output%20tables.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1789038%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1789094%22%20slang%3D%22en-US%22%3ERe%3A%20Reference%20Question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1789094%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F835241%22%20target%3D%22_blank%22%3E%40DonMirabella%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EL1%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DUNIQUE(Source!B1%3AB100)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EM1%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DTRANSPOSE(SORT(FILTER(Source!%24A%241%3A%24A%24100%2C(Source!%24B%241%3A%24B%24100%3DL1))))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1789112%22%20slang%3D%22en-US%22%3ERe%3A%20Reference%20Question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1789112%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F835241%22%20target%3D%22_blank%22%3E%40DonMirabella%3C%2FA%3E%26nbsp%3B%20You%20can%20use%20the%20following%202%20formulas%3A%3C%2FP%3E%3CP%3Eto%20create%20the%20unique%20list%20from%20B%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DUNIQUE(B%3AB)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EThen%20to%20create%20the%20list%20you%20want%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DINDEX(TRANSPOSE(FILTER(A%3AB%2CB%3AB%3DE1))%2C1)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ewhere%20the%20original%20list%20is%20in%20columns%20A%20and%20B%20and%20the%20new%20lists%20are%20in%20E%20and%20F.%26nbsp%3B%20You%20then%20copy%20that%20formula%20down%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1789115%22%20slang%3D%22en-US%22%3ERe%3A%20Reference%20Question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1789115%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BWe%20don't%20have%20Excel%20365%20so%20no%20Unique%20function%20available.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1790531%22%20slang%3D%22en-US%22%3ERe%3A%20Reference%20Question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1790531%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F835241%22%20target%3D%22_blank%22%3E%40DonMirabella%3C%2FA%3E%26nbsp%3BIf%20you%20are%20on%20Excel%202019%20you%20can%20use%20TEXTJOIN%20in%20a%20three%20step%20solution%20as%20shown%20in%20the%20attached%20workbook.%20First%20create%20a%20pivot%20table%2C%20then%20TEXTJOIN%2C%20and%20then%20text-to-columns.%20Not%20very%20elegant%2C%20but%20fairly%20easy%20and%20workable%20if%20this%20is%20something%20you%20do%20once%20or%20only%20every%20now%20and%20then.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOtherwise%2C%20use%20PowerQuery.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EQuery%20the%20table%20in%20the%20two%20columns%2C%20add%20an%20index%20column%2C%20pivot%20the%20index%20with%20column%20A%20as%20the%20value%20(without%20aggregation).%20Then%20merge%20all%20the%20columns%20except%20the%20first%20one%2C%20using%20a%20space%20as%20delimiter.%20Trim%20the%20lot%20and%20split%20the%20column%20by%20space%20delimiter%20to%20get%20the%20table%20you%20desire.%20Load%20back%20to%20Excel.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1790636%22%20slang%3D%22en-US%22%3ERe%3A%20Reference%20Question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1790636%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F835241%22%20target%3D%22_blank%22%3E%40DonMirabella%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20variant%20you%20may%20create%20PivotTable%20on%20the%20range%20with%20adding%20data%20to%20data%20model%20and%20create%20the%20measure%20to%20add%20the%20numbers%20as%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3ENumbes%3A%3DCONCATENATEX(Range%2CRange%5BNumber%5D%2C%22%2C%20%22)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EResult%20is%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20765px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F227228i4C6FE96BC8F23ECC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor


I am trying to figure out how to use the Lookup formulas in Excel to get what I need.

 

I have a 2x100 table of values. The left column, "A", has a series of unique numbers. The right column. "B" has several repeated values, as many as 10 of each value, so not unique.

 

EX: Source Table

 

 A      B

111 Squeeze
112 SacBnt

113 Sneaky

114 PulBak

115 Bnt&Rn

121 Slap

122 FakTak

123 Take

124 Steal

125 Ht&Rn

131 Delay

132 Cancel

133 Repeat

134 Squeeze

135 SacBnt

141 Sneaky

142 PulBak

143 Bnt&Rn

144 Slap

145 FakTak

151 Take

152 Steal

153 Ht&Rn

154 Delay

155 Cancel

211 Repeat

212 Squeeze

213 SacBnt

214 Sneaky

215 PulBak

221 Bnt&Rn

222 Slap

223 FakTak

224 Take

225 Steal

231 Ht&Rn

232 Delay

233 Cancel

234 Repeat

235 Squeeze

241 SacBnt

242 Sneaky

243 PulBak

244 Bnt&Rn

245 Slap

251 FakTak

252 Take

253 Steal

254 Ht&Rn

255 Delay

311 DrgBnt

312 Repeat

313 Squeeze

314 SacBnt

315 Sneaky

321 PulBak

322 Bnt&Rn

323 Slap

324 FakTak

325 Take

331 Steal

332 Ht&Rn

333 Delay

334 DrgBnt

335 Repeat

341 Squeeze

342 SacBnt

343 Sneaky

344 PulBak

345 Bnt&Rn

351 Slap

352 FakTak

353 Take

354 Steal

355 Ht&Rn

411 Delay

412 DrgBnt

413 Repeat

414 Squeeze

415 SacBnt

421 Sneaky

422 PulBak

423 Bnt&Rn

424 Slap

425 FakTak

431 Take

432 Steal

433 Ht&Rn

434 Delay

435 DrgBnt

441 Repeat

442 Squeeze

443 SacBnt

444 Sneaky

445 PulBak

451 Bnt&Rn

452 Slap

453 FakTak

454 Take

455 Steal

 

In a separate table I need to look for the lowest "A" value of each "B" value, then the next lowest, etc... So in the top row of the following table, I need the lowest "A" value of "Take" from the first table, which is 123, then the next lowest is 151, then 224, etc...

 

EX: I need to end up with this table after referencing the source table.

 

Take 123 151 224 252 325 353 431 454
FakTak   122 145 223 251 324 352 425 453
Bnt&Rn 115 143 221 244 322 345 423 451
DrgBnt   311 334 412 435   
SacBnt   112 135 213 241 314 342 415 443
Sneaky   113 141 214 242 315 343 421 444
Squeeze 111 134 212 235 313 341 414 442
PulBak   114 142 215 243 321 344 422 445
Slap        121 144 222 245 323 351 424 452
Ht&Rn   125 153 231 254 332 355 433
Steal       124 152 225 253 331 354 432 455
Delay     131 154 232 255 333 411 434
Cancel    132 155 233    
Repeat    133 211 234 312 335 413 441

 

I've attached a file with the source and output tables.

16 Replies
Highlighted

@DonMirabella 

L1

=UNIQUE(Source!B1:B100)

 

M1

=TRANSPOSE(SORT(FILTER(Source!$A$1:$A$100,(Source!$B$1:$B$100=L1))))

 

Highlighted

@DonMirabella  You can use the following 2 formulas:

to create the unique list from B:

=UNIQUE(B:B)

Then to create the list you want:

=INDEX(TRANSPOSE(FILTER(A:B,B:B=E1)),1)

where the original list is in columns A and B and the new lists are in E and F.  You then copy that formula down

Highlighted

@mtarler We don't have Excel 365 so no Unique function available.

Highlighted

@DonMirabella If you are on Excel 2019 you can use TEXTJOIN in a three step solution as shown in the attached workbook. First create a pivot table, then TEXTJOIN, and then text-to-columns. Not very elegant, but fairly easy and workable if this is something you do once or only every now and then.

 

Otherwise, use PowerQuery. 

Query the table in the two columns, add an index column, pivot the index with column A as the value (without aggregation). Then merge all the columns except the first one, using a space as delimiter. Trim the lot and split the column by space delimiter to get the table you desire. Load back to Excel.

Highlighted

@DonMirabella 

As variant you may create PivotTable on the range with adding data to data model and create the measure to add the numbers as

Numbes:=CONCATENATEX(Range,Range[Number],", ")

Result is

image.png

Highlighted

@Sergei Baklan Thank you Sergei, this looks like the way to go for me. However, when I try to setup my own pivot table in my spreadsheet, the "Add this data to the Data Model" check box is greyed out.

 

I don't see a reason why nor do I see how to change that.

 

Don

Highlighted

@DonMirabella 

One more variant

image.png

In G4

=IFERROR(
   INDEX($B$2:$B$101,
     AGGREGATE(15,6,1/(COUNTIF($G$3:G3,$B$2:$B$101)=0)*(ROW($B$2:$B$101)-ROW($B$1)),
     1)
),"")

and drag it down till empty cell appears.

In H4

=TEXTJOIN(", ",1,IF($B$2:$B$101=$G4,$A$2:$A$101,""))

and also drag down

Highlighted

@DonMirabella 

Don, not sure what it could be with data model. Try formula solution, perhaps it'll be easier and not necessary to refresh data even if PivotTable works.

Highlighted

@Sergei Baklan I found the solution in a few different posts. Had to save as xlsm then close and reopen.

 

Now, I'm not able to recreate your pivot table in my sheet. I don't see the function option in Range field selection window.

 

I'll work on this over the weekend, seems like it'll take some head scratching.

Highlighted

@DonMirabella 

I added measure in Power Pivot, preliminary assigned in it Text type to Number column

image.png

Highlighted

@DonMirabella  another option if you need the numbers in separate cells.

use this equation (which is probably similar or same as previously posted to find the unique names):

            Note: I defined dRange as column B on the Source Tab

= IFERROR(OFFSET(dRange,AGGREGATE(15,7, ROW(dRange)/(--(COUNTIF(OFFSET(dRange,ROW(dRange)-1,0,ROWS(dRange),1),dRange)=1)), ROW())-1,0),"")

 

and then paste this and drag down and to the right as far as needed:

= IFERROR(OFFSET(dRange,AGGREGATE(15,7, ROW(dRange)/(--(dRange=$L1)), COLUMN()-COLUMN($L$1))-1,-1),"") 

This assumes the Unique list column is in L1 and this is in column M

Highlighted

@mtarler 

The difference is in using OFFSET() instead of INDEX(). These two functions often compete, but I prefer the latest.

Highlighted

@Sergei Baklan  ok so you made me look. lol. 

actually there are a couple differences in how we did it. 

as you noted the difference between INDEX vs OFFSET.  I suppose index is more 'appropriate' here since it picks a single reference instead of shifting the range of references.  Maybe it is slightly more efficient? But they are both volatile right?

also your equation looks at the list it has created to find next unique value while mine ranks all the unique values and uses the row to pick the next unique value in that sequence.  Again yours might be a little better since you always select the 1st in the resulting list and hence probably more efficient. 

This is why I love this forum, it helps me see other and often better ways of doing things in Excel

Highlighted

@mtarler , I know both approaches just INDEX() is more comfortable for me and that's the only reason I prefer to work with it. On really big workbooks performance is the core, with the rest as with vodka - we know is it good or bad only next morning - we know good or bad solution mainly on maintenance phase. We may expect and give our estimation, but here some depends on personalities. What is good for one person could be not very suitable for another one.

 

What is really good in Excel is that everything could be done by several ways.

Highlighted
From what I've read, index is not volatile (after Excel 97).
Highlighted