Extract a word from text

Marklarbear

Board Regular
Joined
Nov 6, 2003
Messages
119
Office Version
  1. 365
Platform
  1. Windows
HI brains trust,

I'm after a formula to extract ONLY the word before the word "TEAMS" in a string of data.....

ie in cell A1 I have the following text: ROM MOMENTS NSW KOG TEAM 1

I want to extract the 4th word "KOG" into cell B1......

I have a rather large list of text strings in column A - the first 3 words vary in length, however the 4th word (ie KOG) is either 2 or 3 characters followed by exactly 7 characters (ie space TEAM space 1)

I've started with: =LEFT(A1,SEARCH("Team",A1&"TEAM")-2) however this gives me everything before the word TEAM - I only want the word immediately before TEAM not the rest of the text..... help????
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Perhaps something like this.
Book1
AB
1ROM MOMENTS NSW KOG TEAM 1KOG
Sheet1
Cell Formulas
RangeFormula
B1B1=TRIM(RIGHT(SUBSTITUTE(LEFT(A1,FIND("TEAM",A1)-2)," ",REPT(" ",100)),50))
 
Upvote 0
Solution
Perhaps something like this.
Book1
AB
1ROM MOMENTS NSW KOG TEAM 1KOG
Sheet1
Cell Formulas
RangeFormula
B1B1=TRIM(RIGHT(SUBSTITUTE(LEFT(A1,FIND("TEAM",A1)-2)," ",REPT(" ",100)),50))
That worked brilliantly!!! cheers :)
 
Upvote 0
the 4th word (ie KOG) is either 2 or 3 characters followed by exactly 7 characters
In that case, this should be sufficient

22 11 24.xlsm
AB
1ROM MOMENTS NSW KOG TEAM 1KOG
2Some other words TO Team 1TO
Extract word
Cell Formulas
RangeFormula
B1:B2B1=TRIM(LEFT(RIGHT(A1,10),3))
 
Upvote 0
Also, if it is the 4th word that is to be extracted and if you have the TEXTPLIT function you could use this

22 11 24.xlsm
AB
1ROM MOMENTS NSW KOG TEAM 1KOG
2Some other words TO Team 1TO
Extract word
Cell Formulas
RangeFormula
B1:B2B1=INDEX(TEXTSPLIT(A1," "),4)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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