Lookup part of the string to match with other

indygo

Board Regular
Joined
Dec 2, 2013
Messages
126
Office Version
  1. 365
Platform
  1. Windows
hi guys,

I'm trying to identify product by ID and for some weird reason it doesn't work with either vlookup or xlookup.

Description:
Column A has part of the ID that refers to the Name in Column B.
I want to Vlookup those values to see their corresponding names in C2,D2,E2 and so on (green text).


When I'm trying to put in C2: =vlookup(E2,$A$1:$B$173,2,TRUE) I'm getting the same result for every single column which is "Banana". The problem is that I'm looking up longer string with shorter one.
Obviously the formula should compare two ID's and lookup corresponding name but it doesn't work. Any ideas please?


hlookup doesn't work either.


IDName0_0C732313111654100_21212121124654101_1111444122s
BananaApplePear
0_Banana
654100Apple
654101Pear
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi,

can be solved but only if your product id's are consistent.
The first part of the full product code (till "_"shows the ID) if that's consistent throughout your table only VLOOKUP that part.
Be aware: to create consistency in the ID table i've removed "_" from cell A3
You could try something like this:
Book1
ABCDE
1IDName0_0C732313111654100_21212121124654101_1111444122s
2BananaApplePear
30Banana
4654100Apple
5654101Pear
Sheet1
Cell Formulas
RangeFormula
C2:E2C2=VLOOKUP(VALUE(LEFT(C$1,SEARCH("_",C$1,1)-1)),$A$1:$B$5,2,0)
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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