Vlookup with strings

jgopalk

New Member
Joined
Jun 14, 2011
Messages
26
Hi there,

I tried lot to fix this. But I couldn't make it up. Kindly guide me in this.

I have keywords with few strings. I need to get those words too by vlookup.

For example:
Table: 1 (Reference sheet)
AppleFruit
OrangeFruit
Ladies fingerVegetable
CarrotVegetable
BananaFruit
JasminFlower

<tbody>
</tbody>



Table: 2 (My question)

Apple | Orange | Banana
Apple | Jasmine
Carrot
Apple
Ladies finger; Orange

<tbody>
</tbody>

Table: 3 (outcome)

Apple | Orange | BananaFruits & Fruits & Fruits
Apple | Jasmine Fruits & Flower
Carrot Vegetable
Apple Fruit
Ladies finger; OrangeVegetable & Fruit

<tbody>
</tbody>

Here, already I have Table 1 with ~ 20000 keywords. I have “Table 2” to be filled like “Table 3”. I will have maximum of two strings. One is “ | “ and next is “ ; ”.

For single keyword, I know we can directly apply Vlookup. But this case of stings how can we proceed further?

Hope I have explained my requirement clearly. Kindly let me know if you have any further questions.

My extreme thanks in advance.

Gopal
 
Last edited:
Hi Aladin,

See in Ladies finger the formula consider that as two words and giving two results (highlighted in red). Single cell content need to be considered as single value. For Ladies finger result should be Vegetable alone and not "Vegetable + Gender".

AppleFruitApple | Orange | BananaFruit & Fruit & Fruit
OrangeFruitApple | JasmineFruit & Flower
Ladies fingerVegetableCarrotVegetable
CarrotVegetableApple | fingerFruit & Flower
BananaFruitLadies finger; OrangeFruit & Vegetable & Gender
JasminFlowerlettuce | spinach | appleFruit & vegetable & vegetable
lettucevegetableBrussels | zucchinivegetable & vegetable
spinachvegetableceleryvegetable
Brusselsvegetableonion | fofu | soybeansvegetable & Legumes
zucchinivegetablelentil flour | broccoliLegumes & vegetable
celeryvegetableLadies fingerVegetable & Gender
onionvegetable
soybeansLegumes
lentil flourLegumes
broccolivegetable
potatovegetable
LadiesGender

<tbody>
</tbody>


Kindly suggest me how to move forward.

Thanks again for your help in this.

Gopal

1. Sort A:B on column A in ascending order.

2. In D (input sentences) replace ; with |.

3. Now invoke: Control+sshift+enter...

=REPLACE(aconcat(IF(ISNUMBER(SEARCH(SUBSTITUTE($A$2:$A$18," ","")&"|",SUBSTITUTE($D2," ","")&"|"))," & "&$B$2:$B$18,"")),1,3,"")

and copy down.
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,214,591
Messages
6,120,425
Members
448,961
Latest member
nzskater

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