Assume your data with headers looks like this:
Who Spec Size
Frank MEP2 2
Frank IAEMID 248
Frank GABELLI 248
Frank GABELLI 2
Frank ML 248
Frank CSFB 248
SAM ML 2
SAM UBS 4
Create a Pivot Table..
Layout: Drag Who and Spec into Row, Sum of Size into Data.
Options: Uncheck Grand Totals, AutoFormat.
The PT should look like this:
Who Spec Total
Frank CSFB 248
GABELLI 250
IAEMID 248
MEP2 2
ML 248
SAM ML 2
UBS 4
Notice GABELLI appears only once and has a total of 248+2=250
Pivot Table was used only for this one purpose.
If Who in the PT is located at A20, WhoS is at D20
WhoS Spec_S Cats
Frank CSFB-248, CSFB-248,
Frank GABELLI-250, CSFB-248,GABELLI-250,
Frank IAEMID-248, CSFB-248,GABELLI-250,IAEMID-248,
Frank MEP2-2, CSFB-248,GABELLI-250,IAEMID-248,MEP2-2,
Frank ML-248, CSFB-248,GABELLI-250,IAEMID-248,MEP2-2,ML-248,
SAM ML-2, ML-2,
SAM UBS-4, ML-2,UBS-4,
The formulas for WhoS, Spec_S and Cats are respectively
=IF(A21="",D20,A21)
=B21&"-"&C21&","
=IF(A21="",F20&E21,E21)
Name the columns with the suggested names.
Create and name 2 cells:
Target Result
Frank CSFB-248,GABELLI-250,IAEMID-248,MEP2-2,ML-248,
Enter the name you want to look up into Target
The Result formula is:
=INDEX(Cats,MATCH(Target,WhoS,0)+COUNTIF(WhoS,Target)-1)