Extract the word which carries the specific text

pratheesh1983

Board Regular
Joined
Aug 13, 2015
Messages
57
Office Version
  1. 365
Platform
  1. Windows
Hi everyone, In order to extract a word (s) that has a specified text in the word string, I'm searching for an Excel formula. I've included a couple examples of how the data should look below.

The table below, consisting of three columns, displays the text for searching in the first column, followed by a word string in the second column for searching words that match the text in the first column. Column 3 should contain the extracted data using the formula.

I have provided a few samples and expected results, which the Excel formula should extract in column 3. I would really appreciate it if anyone could help me in getting the formula that I can use in column 3.

123
Text To be SearchedText String which needs to searchedExtracted Word
ESCOFRANSISCO MARTIN RIESCOFRANSISCO
ESCOGIVESCO BAKERY A/SGIVESCO
ES COSHIPPING LINES CO. LTDLINES CO.
ESCOCUOTA SPCIS (NINA PALMERO ESCOFET)ESCOFET
ESC OLOYER ESC OCT 24ESC OCT
ESC OALIMENTARE FRANCESC O LUPOLIFRANCESC O
COESBATISTA CONTRUCOES SACONTRUCOES
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Can we assume that the substring will always exists in the text?
 
Upvote 0
If you first example is looking for "ESCO", shouldn't it return "RIESCO" and not "FRANCISCO"?
 
Upvote 0
With the new regex functions if you already have them

Excel Formula:
=REGEXEXTRACT(B1:B7,"\pL*"&A1:A7&"\pL*")
 
Upvote 0
First pass.
Book1
ABCDE
1Text To be SearchedText String which needs to searchedExtracted WordFormulaCheck
2ESCOFRANSISCO RIESCO MARTINRIESCORIESCOTRUE
3ESCOGIVESCO BAKERY A/SGIVESCOGIVESCOTRUE
4ES COSHIPPING LINES CO. LTDLINES CO.LINES CO.TRUE
5ESCOCUOTA SPCIS (NINA PALMERO ESCOFET)ESCOFETESCOFET)FALSE
6ESC OLOYER ESC OCT 24ESC OCTESC OCTTRUE
7ESC OALIMENTARE FRANCESC O LUPOLIFRANCESC OFRANCESC OTRUE
8COESBATISTA CONTRUCOES SACONTRUCOESCONTRUCOESTRUE
9R ESC OOCT LOYER ESC OCT 24LOYER ESC OCTLOYER ESC OCTTRUE
Sheet2
Cell Formulas
RangeFormula
D2:D9D2=LET(s,LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1,t,TEXTSPLIT(B2,," "),TEXTBEFORE(TEXTJOIN(" ",1,IF(SCAN(0,LEN(t),SUM)+1>=SEARCH(A2,B2),t,""))&" "," ",s))
E2:E9E2=C2=D2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:E9Cell Value=TRUEtextNO
E2:E9Cell Value=FALSEtextNO
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
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