VLookup for numbers contained within cells with numbers and text

cdubs34

New Member
Joined
Jul 26, 2011
Messages
34
Hello,

I am trying to vlookup (or whatever the necessary function may be) so that in the example below, I can match the numbers in the Code column to their match in the Brand column and have the corresponding cell contents of the Category column get put into the Output column.

Hopefully this makes sense. Your help is much appreciated. Thank you.

<colgroup><col style="mso-width-source:userset;mso-width-alt:7862;width:161pt" width="215"> <col style="mso-width-source:userset;mso-width-alt:3364;width:69pt" width="92"> </colgroup><tbody>
</tbody>

Brand
Category
Code
Output
123 Brand A
Clothes
456
456 Brand B
Food
123
789 Brand C
Stuff
789

<tbody>
</tbody>
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi,

Perhaps use a wildcard like this:
Excel Workbook
ABCDE
1BrandCategoryCodeOutput
2123 Brand AClothes456Food
3456 Brand BFood123Clothes
4789 Brand CStuff789Stuff
Sheet1
Excel 2010
Cell Formulas
RangeFormula
E2=VLOOKUP(D2&"*",A$2:B$4,2,0)
 
Upvote 0
Thank you very much. That worked perfectly. Should have asked this in the original post, but can you also let me know how i would do this exercise the opposite way. So vlookup on the numbers in column A to match up with the numbers in column D. Thanks again for your help
 
Upvote 0
Thank you very much. That worked perfectly. Should have asked this in the original post, but can you also let me know how i would do this exercise the opposite way. So vlookup on the numbers in column A to match up with the numbers in column D. Thanks again for your help

Your welcome. Perhaps try these alternatives (the first if you know your numbers are always 3 digits:
Excel Workbook
ABCDEF
1BrandCategory (Method 1)Category (Method 2)CodeOutput
2123 Brand AClothesClothes456Food
3456 Brand BFoodFood123Clothes
4789 Brand CStuffStuff789Stuff
Sheet1
Excel 2010
Cell Formulas
RangeFormula
B2=VLOOKUP(--LEFT(A2,3),E$2:F$4,2,0)
C2=VLOOKUP(--LEFT(A2,FIND(" ",A2)),E$2:F$4,2,0)
 
Upvote 0

Forum statistics

Threads
1,215,172
Messages
6,123,443
Members
449,100
Latest member
sktz

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