Complicated Lookup

Switch

New Member
Joined
Nov 10, 2002
Messages
7
Hi all,

Can anyone please help!!

In column A and B, are examples of descriptions that come through from a sales system to Excel.

In Column C is an example of what I would like to change the descriptions to in columns A and B respectively.

What the formula needs to do is match the 5 digit number at the beginning of column C to the same 5 digits found somewhere in A or B and then return a description that is the same as column C (the lookup table)

I would greatly appreciate somke help.
CUBE CODES PRACTITIONER.xls
ABCD
1Eaxmple1ofalistasitcomesthroughfromMasterSalesSystemEaxmple2ofalistasitcomesthroughfromMasterSalesSystemMasterDescriptionList
29303002-CELLIODCHARTCelloidChart_0300203002_CelloidChart
39303023-CELLOIDSP96(84)SP96(84)_0302303023_SP96(84)
49303024-CELLOIDSS69(84)SS69(84)_0302403024_SS69(84)
59303025-CELLOIDCP57(84)CP57(84)_0302503025_CP57(84)
69303026-CELLOIDIP82(84)IP82(84)_0302603026_IP82(84)
79303027-CELLOIDPP85(84)PP85(84)_0302703027_PP85(84)
Sheet2


Kind regards
Switch
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Switch,
Hope I don't tread on the regular's toes, but try a combination of the FIND, LEFT, RIGHT, MID, PROPER and TRIM functions.

For Column b: =RIGHT(B2,LEN(B2)-FIND("_",B2))&"_"&LEFT(B2,FIND("_",B2)-1)
For column a: =MID(A2,3,FIND("-",A2)-4)&"_"&TRIM(PROPER(RIGHT(A2,LEN(A2)-FIND("-",A2)-1)))

Good luck
 
Upvote 0
From the example data you given, it looks like the data in column A may be redundant, as you can get the syntax/format like C from the data in B.

However...(hoping I've understood the requirement properly)
Add a column to the left of column A (for this explanantion call it New) into which you enter the following formula in each cell corresponding to data in A
=MID(A1,3,5)
=>> creates a lookup/key column by returning the 5 digit code required for the lookup.

Assume the 5 digit item code for the selected item is input into E1, in the cell where you want the data returned (say F1), enter:
=VLOOKUP(E1,New1:New999,4,false)
returns the single value in column C (4th column from New column) for the matching value in New column.

HTH
 
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