Extracting a word from the text

pratheesh1983

Board Regular
Joined
Aug 13, 2015
Messages
55
Office Version
  1. 365
Platform
  1. Windows
I need an Excel formula that will find the word that has a certain text on it. In the table below, I've tried to show what I mean. In column A, you can see the word that needs to be found in column B of the text, and in column C, where the formula should go to get the needed word, I would appreciate it if anyone could help find a formula for it.



ABC
Word to be searchedTextExtracted Word (Formula)
Susan Susan SantosSusan
SusanSusanna MoySusanna
SusanSusann LoweSusann
SusanElisabete Susana SanchezSusana
SusanA.C.B SusanneSusanne

Thanks in advance
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Try pasting this in C2 and filling down:
Excel Formula:
=FILTER(TEXTSPLIT(B2," "),ISNUMBER(SEARCH(A2,TEXTSPLIT(B2," "))))

Note that in the case of:
"Susanne Susanna Susan" would result in Susanne in Column C, Susanna in Column D, and Susan in Column E
 
Upvote 0
Another option in column D, using a similar idea shown by @MountainFog...and then if you want the results contained within a single cell separated with a delimiter (comma here), @MountainFog's formula could be wrapped with a TEXTJOIN:
MrExcel_20240112.xlsx
ABCD
2SusanSusan SantosSusanSusan
3SusanSusanna MoySusannaSusanna
4SusanSusann LoweSusannSusann
5SusanElisabete Susana SanchezSusanaSusana
6SusanA.C.B SusanneSusanneSusanne
7SusanSusanne SusannadannaSusanne, SusannadannaSusanne, Susannadanna
Sheet5
Cell Formulas
RangeFormula
C2:C7C2=TEXTJOIN(", ",,FILTER(TEXTSPLIT(B2," "),ISNUMBER(SEARCH(A2,TEXTSPLIT(B2," ")))))
D2:D7D2=LET(a,BYCOL(TEXTSPLIT(B2," "),LAMBDA(c,IF(ISNUMBER(SEARCH(A2,c)),c,""))),TEXTJOIN(", ",,a))
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,958
Members
449,096
Latest member
Anshu121

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