Need formula to find partial string match in a separate column and return adjacent value

majesticoj

New Member
Joined
Nov 19, 2019
Messages
7
I've found formulas where you can use a "wild card", so to speak, to find a partial string match within another column:

=IFERROR(INDEX(E:E,MATCH("*"&C1&"*",D:D,0)),"")

For instance, this formula would find "dog" (C1) in "took the dog out" (D3) and return "yesterday" (E2).

However my strings in columns C and D aren't laid out in that way.

For instance, I need to partial match and return adjacent value when C1 is "took the dog out" and D3 is "dog". Putting wildcards around C1 wouldn't work.

Example file here.

(Forgive me for not finding a succinct and articulate way to to verbalize the exact formula I'm looking for)
 
Last edited by a moderator:
Wow. My apologies for not reviewing my thread title before submitting!!! I would edit the thread title but it appears I cannot do so.

This should have been the title: Need formula to find partial string match in a separate column and return adjacent value.
 
Upvote 0
Try this option

Book1
ABCDEF
1glue-4-redbookAC
2book-2-greengumBA
3pencil-3-brownglueCD
4pencilD
5
Sheet1
Cell Formulas
RangeFormula
F1:F3F1{=IFERROR(INDEX($E$1:$E$4,MAX((IFERROR(SEARCH($D$1:$D$4,C1),-1))*(ROW($D$1:$D$4)))),"No match")}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
@DanteAmor Thank you! I'm not sure but I think your formula is trying to find an exact match for C1 in column D...?

I probably wasn't clear before. Here is the exact scenario I have for which I'm trying to make a formula. I think this context will help everyone better understand.

I need to match product filenames (column C) to SKUs (column D) and return the adjacent product name (column E).

Example: The formula should "match" product-redsocks1-small (C2) with redsocks1 (D4) and return adjacent cell value Red Socks (E4).

(Ultimately, I'm trying to get the formula to match photo file names in column C with the matching product name (for the photo/file) in column E)

Example table here.
 
Upvote 0
I think you made a mistake on file, this is what you sent.
You must put the expected result and explain why that result.

Book1
ABCDEF
1glue-4-redbookgum
2book-2-greengumglue
3pencil-3-browngluebook
4
Sheet1
 
Upvote 0
@DanteAmor

I have linked to a new file here.

I need to match product filenames (column C) to SKUs (column D) and return the adjacent product name (column E).

Here is an example with expected result: The formula should "match" product-redsocks1-small (C2) with redsocks1 (D4) and return adjacent cell value Red Socks (E4).

Ultimately, I'm trying to get the formula to match photo file names in column C with the matching product name (for the photo/file) in column E.
 
Upvote 0
This is the result of my formula with your data.
But the result is not clear, since you have the same data in column D and column E.

Book1
ABCDEFG
1glue-4-redbookgumbook
2book-2-greengumglue
3pencil-3-browngluebook
4
Sheet1
Cell Formulas
RangeFormula
F1F1{=IFERROR(INDEX($E$1:$E$3,MAX((IFERROR(SEARCH($D$1:$D$3,C1),-1))*(ROW($D$1:$D$3)))),"No match")}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.


That's why I proposed some data.
I will change them, the formula remains the same.


Book1
ABCDEFG
1glue-4-redbooktodaytomorrow
2book-2-greengumyesterday
3pencil-3-browngluetomorrow
4
Sheet1
Cell Formulas
RangeFormula
F1F1{=IFERROR(INDEX($E$1:$E$3,MAX((IFERROR(SEARCH($D$1:$D$3,C1),-1))*(ROW($D$1:$D$3)))),"No match")}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.


-------------------------
Remember, it is an array formula, to accept you must press Shift + Control + Enter
 
Upvote 0
@DanteAmor

Thanks again!

The file I uploaded again had different table values but the same file name in that directory as before... Maybe I should have changed the file name when saving...

I did try your instructions again and this time, used your instructions about this being an 'array formula' and it worked!

Thank you!!!
 
Upvote 0

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