VLOOKUP on start of cell contents

phunkyfeelone

New Member
Joined
Oct 10, 2013
Messages
2
Hi, long time listener, first time poster

I have two sets of data, as per example below, and trying to figure out the syntax to perform a lookup based on the first two words in a cell (separated by a comma) in the corresponding data, and return a mapped value.

Master Data

[TABLE="width: 304"]
<tbody>[TR]
[TD][TABLE="width: 300"]
<tbody>[TR]
[TD]Stock[/TD]
[TD]Description[/TD]
[TD]Code[/TD]
[/TR]
[TR]
[TD]12345678[/TD]
[TD]WIDGET,BLUE,STRIPEY[/TD]
[TD]X1[/TD]
[/TR]
[TR]
[TD]12345679[/TD]
[TD]WIDGET,WHITE,SPOTTY[/TD]
[TD]X2[/TD]
[/TR]
[TR]
[TD]13456802[/TD]
[TD]WIDGET,YELLOW,SPARKLES[/TD]
[TD]X3[/TD]
[/TR]
[TR]
[TD]23498756[/TD]
[TD]WIDGET,BLUE,SPOTTY[/TD]
[TD]X4[/TD]
[/TR]
[TR]
[TD]32165498[/TD]
[TD]WIDGET,GREEN,PLAIN[/TD]
[TD]X5[/TD]
[/TR]
[TR]
[TD]45678912[/TD]
[TD]WIDGET,BLACK,SPOTTY[/TD]
[TD]X6[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Lookup Data[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 300, align: left"]
<tbody>[TR]
[TD]Primary[/TD]
[TD]Secondary[/TD]
[TD]Combo[/TD]
[TD]Code[/TD]
[/TR]
[TR]
[TD]WIDGET[/TD]
[TD]BLUE[/TD]
[TD]WIDGET,BLUE[/TD]
[TD]11111111[/TD]
[/TR]
[TR]
[TD]WIDGET[/TD]
[TD]YELLOW[/TD]
[TD]WIDGET,YELLOW[/TD]
[TD]22222222[/TD]
[/TR]
[TR]
[TD]WIDGET[/TD]
[TD]WHITE[/TD]
[TD]WIDGET,WHITE[/TD]
[TD]33333333[/TD]
[/TR]
[TR]
[TD]WIDGET[/TD]
[TD]GREEN[/TD]
[TD]WIDGET,GREEN[/TD]
[TD]44444444[/TD]
[/TR]
[TR]
[TD]WIDGET[/TD]
[TD]BLACK[/TD]
[TD]WIDGET,BLACK[/TD]
[TD]55555555[/TD]
[/TR]
</tbody>[/TABLE]










In effect, I need to look up the first two words in the Master Data, in the Lookup Data (either ColA&ColB or Col C), and return the code to the Master Data.
So for example, the result should look like this:

Master Data (New)
[TABLE="width: 300"]
<tbody>[TR]
[TD]Stock[/TD]
[TD]Description[/TD]
[TD]Code[/TD]
[/TR]
[TR]
[TD]12345678[/TD]
[TD]WIDGET,BLUE,STRIPEY[/TD]
[TD]11111111[/TD]
[/TR]
[TR]
[TD]12345679[/TD]
[TD]WIDGET,WHITE,SPOTTY[/TD]
[TD]33333333[/TD]
[/TR]
[TR]
[TD]13456802[/TD]
[TD]WIDGET,YELLOW,SPARKLES[/TD]
[TD]22222222[/TD]
[/TR]
[TR]
[TD]23498756[/TD]
[TD]WIDGET,BLUE,SPOTTY[/TD]
[TD]11111111[/TD]
[/TR]
[TR]
[TD]32165498[/TD]
[TD]WIDGET,GREEN,PLAIN[/TD]
[TD]44444444[/TD]
[/TR]
</tbody>[/TABLE]

Any thoughts or suggestions?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
something like this?

<table border = "1" cellspacing = "0" bordercolor="#999999">
<tr><td bgcolor="#C0C0C0"> </td>
<td align="center" bgcolor="#C0C0C0"><b>A</b></td><td align="center" bgcolor="#C0C0C0"><b>B</b></td><td align="center" bgcolor="#C0C0C0"><b>C</b></td><td align="center" bgcolor="#C0C0C0"><b>D</b></td><td align="center" bgcolor="#C0C0C0"><b>E</b></td><td align="center" bgcolor="#C0C0C0"><b>F</b></td><td align="center" bgcolor="#C0C0C0"><b>G</b></td><td align="center" bgcolor="#C0C0C0"><b>H</b></td><td align="center" bgcolor="#C0C0C0"><b>I</b></td><td align="center" bgcolor="#C0C0C0"><b>J</b></td><td align="center" bgcolor="#C0C0C0"><b>K</b></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>1</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000"><b>Stock </b></font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000"><b>Description </b></font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000"><b>Code </b></font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">Primary </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123"><b>Secondary </b></font></td><td rowspan="1" colspan="1" width="435" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123"><b>Combo </b></font></td><td rowspan="1" colspan="1" width="444" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123"><b>Code </b></font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>2</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">12345678 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,BLUE,STRIPEY </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">X1 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">BLUE </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET,BLUE </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">11111111 </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>3</b></td><td rowspan="1" colspan="1" width="414" height="57" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">12345679 </font></td><td rowspan="1" colspan="1" width="735" height="57" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,WHITE,SPOTTY </font></td><td rowspan="1" colspan="1" width="561" height="57" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">X2 </font></td><td rowspan="1" colspan="1" width="192" height="57" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="57" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="57" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="57" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="57" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET </font></td><td rowspan="1" colspan="1" width="399" height="57" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">YELLOW </font></td><td rowspan="1" colspan="1" width="435" height="57" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET,YELLOW </font></td><td rowspan="1" colspan="1" width="444" height="57" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">22222222 </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>4</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">13456802 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,YELLOW,SPARKLES </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">X3 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WHITE </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET,WHITE </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">33333333 </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>5</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">23498756 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,BLUE,SPOTTY </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">X4 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">GREEN </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET,GREEN </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">44444444 </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>6</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">32165498 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,GREEN,PLAIN </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">X5 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">BLACK </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">WIDGET,BLACK </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#574123">55555555 </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>7</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">45678912 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,BLACK,SPOTTY </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">X6 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>8</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>9</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>10</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>11</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>12</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>13</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000"><b>Stock </b></font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000"><b>Description </b></font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000"><b>Code </b></font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>14</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">12345678 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,BLUE,STRIPEY </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">=VLOOKUP(MID(B14,1,FIND(",",B14,FIND(",",B14,1)+1)-1),$J$1:$K$6,2,FALSE) </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>15</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">12345679 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,WHITE,SPOTTY </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">=VLOOKUP(MID(B15,1,FIND(",",B15,FIND(",",B15,1)+1)-1),$J$1:$K$6,2,FALSE) </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>16</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">13456802 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,YELLOW,SPARKLES </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">=VLOOKUP(MID(B16,1,FIND(",",B16,FIND(",",B16,1)+1)-1),$J$1:$K$6,2,FALSE) </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>17</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">23498756 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,BLUE,SPOTTY </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">=VLOOKUP(MID(B17,1,FIND(",",B17,FIND(",",B17,1)+1)-1),$J$1:$K$6,2,FALSE) </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>18</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">32165498 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,GREEN,PLAIN </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">=VLOOKUP(MID(B18,1,FIND(",",B18,FIND(",",B18,1)+1)-1),$J$1:$K$6,2,FALSE) </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>19</b></td><td rowspan="1" colspan="1" width="414" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">45678912 </font></td><td rowspan="1" colspan="1" width="735" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">WIDGET,BLACK,SPOTTY </font></td><td rowspan="1" colspan="1" width="561" height="30" align = "left" valign = "top" bgcolor ="#FFFFFF"><font color="#000000">=VLOOKUP(MID(B19,1,FIND(",",B19,FIND(",",B19,1)+1)-1),$J$1:$K$6,2,FALSE) </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="390" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="399" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="435" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td><td rowspan="1" colspan="1" width="444" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
</table>
 
Upvote 0
Let Sheet1 house the master data, Sheet2 the lookup data.

Sheet1, C2, just enter, and copy down:

=LOOKUP(9.99999999999999E+307,SEARCH(Sheet2!$C$2:$C$6,$B2),Sheet2!$D$2:$D$6)
 
Upvote 0
I have assumed you want to replace the values X1, X2 etc with the values in the lookup table which I have placed in the range A12:D17.

=VLOOKUP(LEFT(B2,FIND(",",B2,FIND(",",B2,1)+1)-1),$C$13:$D$17,2,0)

This effectively works out where the second coma is to determine the name(s) to look for in the Lookup Data
 
Upvote 0
Thanks all

shadow12345, works perfectly
Aladin Akyurek, already have data in different worksheets, just simplified it to get the syntax. Not sure about the rest of your solution though!
DavidCoop, also works perfectly, with slightly more efficient code.

Appreciate the quick responses
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

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