Note: The other languages of the website are Google-translated. Back to English

How to extract text between two words in Excel?

For a list of text strings as shown in the screenshot below, to extract the text string between two words "KTE" and "feature" from each cell, are there any good ways to solve it? This tutorial introduces two methods to help you get it done.

Extract text between two words with formula in Excel
Extract text between two words with an amazing tool


Extract text between two words with formula

You can use a formula based on the MID function and the SEARCH function to extract all text strings between two words within a cell.

Generic formula

=MID(cell,SEARCH("start_word",cell)+length1,SEARCH("end_word",cell)-SEARCH("start_word",cell)-length2)

Arguments

Cell: the cell from which you want to extract all text strings between two words;
Start_word: the start word of the two words you want to extract all text strings after it;
Length1: the length of the start word.
End_word: the end word of the two words you want to extract all text strings before it.
Length2: the length of the start word plus 1.

Select a blank cell, copy or enter the formula below and press the Enter key to get the result. Select this result cell and then drag its AutoFill Handle down to apply this formula to other cells.

=MID(B5,SEARCH("KTE",B5)+3,SEARCH("feature",B5)-SEARCH("KTE",B5)-4)

Note: In the formula, the number 3 represents the character length of the word "KTE"; the number 4 represents the character length of the word "KTE" plus 1.

You can see all text strings between the specified two words are extracted from each cell in column B.


3.2.2 Extract text between two words with an amazing tool

For many Excel users, formulas may be hard to remember and handle. Here, with the Extract strings between specified text feature of Kutools for Excel, you can easily extract text between two words with just a few clicks.

1. Select a cell to output the result, and then click Kutools > Formula Helper > Formula Helper.

2. In the Formula Helper dialog box, you need to configure as follows.

2.1) Check the Filter box and then enter the word “Extract” into the text box;
2.2) In the Choose a formula list box, click the Extract strings between specified text option;
2.3) In the Arguments input section:
In the Cell box, select a cell where you want to extract the text (here I select cell B5);
In the Start char(s) box, enter the start word of the two words you want to extract all text strings after it;
In the End char(s) box, enter the end word of the two words you want to extract all text strings before it.
2.4) Click Ok. See screenshot:

3. Then all text strings between two words “KTE” and “feature” within the cell B5 is extracted. Meanwhile, a formula has been created, you can select this result cell and then drag its AutoFill Handle down to extract texts from other cells in the same list.

  If you want to have a free trial ( 30-day) of this utility, please click to download it, and then go to apply the operation according above steps.


Relative Articles:


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Excellent post! Saved my live :)
This comment was minimized by the moderator on the site
Hello, there is an issue with the first formula which only worked for me if I use lenght1 = length2 despite the searched word lengths had been different. Can you check that and correct please?
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations