Given a sheet like so:
Sheet 1
Product Name
-----------------
Fancy Shoes
Plain Shoes
Comfy Slippers
Nice Loafers
Pressed Shirt
Tee Shirt
Collared Button-Up
The below is an array formula (entered with Ctrl+Shift+Enter):
=INDEX(Sheet2!$B$1:$B$5,MATCH(1,MATCH(Sheet2!$A$1:$A$5,Sheet1!A1,0),0))
You can use "Formulas" > "Evaluate Formula" on the cell containing the formula to see how it's working step by step.
If there are only two words in each cell and the word that determines the category (ex.: Shoes, Slippers, Shirt, etc...) is always second, you can use the following INDEX/MATCH
to get the category:
=INDEX('Sheet 2'!B$2:B$6,MATCH(MID('Sheet 1'!A2,FIND(" ",'Sheet 1'!A2)+1,LEN('Sheet 1'!A2)-FIND(" ",'Sheet 1'!A2)),'Sheet 2'!A$2:A$6,0))
Based on my reading here (specifically the note at the bottom), this seems to not be possible using VLOOKUP
alone. If all of your wildcards don't have spaces, you could do it like this: (not an explicit formula, just a list of algorithmic steps)
FIND
to get the location of the first space in the reversed version, subtracting that from the LEN
of the string gives you the amount of string before the wildcard bit.RIGHT
to truncate the string to the wildcard, and use that with VLOOKUP
.