Extracting a word from the text

pratheesh1983

Board Regular
Joined
Aug 13, 2015
Messages
57
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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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