VLOOKUP using text

mdt1972

New Member
Joined
Jul 26, 2016
Messages
1
Hey Everyone,


I'm sure what I'm thinking of is possible, but I am struggling with using VLOOKUP within a text string. Below in my example I need to compare the test name in column C to the test name in Column A. When a match is found I need it to fill in the corresponding numeric test code in column B into Column D. The problem I am having is that the names are not always exact. For example Lab 1 may call the test "Heavy Metals Profile Urine" and Lab 2 may call the same test just "Heavy Metals". Is there a way to match on partial words or begining words in a formula where there is a text string? or am I thinking in the wrong direction. Any guidance would be greatly appreciated
Lab Test Name 1</SPAN>Lab Test Code 1</SPAN>Lab Test Name 2</SPAN>Lab Test Code Match</SPAN>
HLA B5701 Test</SPAN>6790</SPAN>Cholinesterase, Serum</SPAN>
Cholinesterase</SPAN>24365</SPAN>HLA</SPAN>
Heavy Metals Profile, Urine</SPAN>2345</SPAN>Alkaline Phosphatase</SPAN>
CMV</SPAN>2345</SPAN>Alkaline Phosphatase Bone</SPAN>
Lead</SPAN>86478</SPAN>Lead, Blood</SPAN>
Selenium, Urine</SPAN>2145</SPAN>Albumin, CSF</SPAN>
Tricyclic Antidepressants</SPAN>345</SPAN>Heavy Metals </SPAN>
Albumin CSF</SPAN>967865</SPAN>Selenium</SPAN>
Alkaline Phos</SPAN>12345</SPAN>CMV Antibodies</SPAN>

<TBODY>
</TBODY><COLGROUP><COL><COL><COL><COL></COLGROUP>
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I'm not sure if this will work for you but try the following.

Name the data in your first two columns "testcode1"

Then use the formula in your Lab Test Code Match column (I assume that is column D) =IFERROR(VLOOKUP(C2&"*",testcode1,2,FALSE),"")
 
Upvote 0
Really you should clean the data by standardising your naming of products or even better don't use names at all, use codes for ID purposes.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,581
Members
449,089
Latest member
Motoracer88

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