find partial match of string between two arrays

codingchemist

New Member
Joined
Jun 29, 2018
Messages
2
I have two arrays. Array A has a list of multiple terms in a column such as this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Urinary Bladder Cancer|Bladder Tumors|Transitional Cell Carcinoma of the Bladder|Malignant Melanoma|Melanoma|Skin Cancer|Carcinoma, Non-Small-Cell Lung|Lung Cancer[/TD]
[/TR]
[TR]
[TD]Platinum Sensitive Ovarian Cancer|Ovarian Cancer[/TD]
[/TR]
[TR]
[TD]Gastric Cancer[/TD]
[/TR]
</tbody>[/TABLE]

Array B has a list of single terms such as this:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Gastric Cancer[/TD]
[/TR]
[TR]
[TD]Ovarian Cancer[/TD]
[/TR]
[TR]
[TD]Bladder Cancer[/TD]
[/TR]
</tbody>[/TABLE]

I want to map the terms from Array B onto Array A. So, I want Array A to look like, with the terms from Array B included in it.
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Urinary Bladder Cancer|Bladder Tumors|Transitional Cell Carcinoma of the Bladder|Malignant Melanoma|Melanoma|Skin Cancer|Carcinoma, Non-Small-Cell Lung|Lung Cancer[/TD]
[TD]Bladder Cancer[/TD]
[/TR]
[TR]
[TD]Platinum Sensitive Ovarian Cancer|Ovarian Cancer[/TD]
[TD]Ovarian Cancer[/TD]
[/TR]
[TR]
[TD]Gastric Cancer[/TD]
[TD]Gastric Cancer[/TD]
[/TR]
</tbody>[/TABLE]

Normally I would do an index match, but I need to find a partial match from Array A to Array B. Is there an easy way to do this?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Book1
ACD
1Gastric CancerUrinary Bladder Cancer|Bladder Tumors|Transitional Cell Carcinoma of the Bladder|Malignant Melanoma|Melanoma|Skin Cancer|Carcinoma, Non-Small-Cell Lung|Lung CancerBladder Cancer
2Ovarian CancerPlatinum Sensitive Ovarian Cancer|Ovarian CancerOvarian Cancer
3Bladder CancerGastric CancerGastric Cancer
Sheet1


In D1 enter and copy down:

=LOOKUP(9.99999999999999E+307,SEARCH(" "&$A$1:$A$3&"|"," "&$C1&"|"),$A$1:$A$3)
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

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