How to extract part of text string from cell in Excel? (2023)

>> QUICK NAVIGATION

Extract by position Extract by char Extract betweenExtract email address Extract numbers or alpha Sample File Relative Articles

How to extract part of text string from cell in Excel?

How to extract part of text string from cell in Excel? (1)

This tutorial shows the methods on extract substring from left, middle or right of a cell, and also explain how to extract text before or after a specific character as below screenshots shown.

  • Extract substring from left, mid or right
    Method A: formula Method B: handy tool
  • Extract substring after or before a specified character
    Method A: formula Method B: handy tool
  • Extract substring between two characters
    Method A: formula Method B: a handy addin tool
  • Extract E-mail address from a string
  • Extract numeric or alphabetical characters from string
  • Download sample file
  • Other Operations (Articles) Related To Spaces
    Extract nth character from string Extract time from datetime So on..

Extract substring from left, mid or right

Method A: Extract substring from left, middle or right by using formula

In Excel, there are some formulas can help you to quickly extract part of text.

Extract first n characters

Supposing you want to extract first 3 characters from a given list data, please select a blank cell that you want to place the extracted result, then use this formula

=LEFT(B3,3)

B3 is the cell you extract characters from, 3 is the number of characters you want to extract.

Press Enter key to get the extracted result. Then drag fill handle over the cells to apply this formula.
How to extract part of text string from cell in Excel? (2)

Extract last n characters

For example, extract last 6 characters from a list of string, please select a blank cell that you want to place the extracted result and use this formula:

=RIGHT(B9,6)

B9 is the cell you extract characters from, 6 is the number of characters you want to extract.

Press Enter key to get the extracted result. Then drag fill handle over the cells to apply this formula.
How to extract part of text string from cell in Excel? (3)

Extract n characters form middle

If you want to extract 3 characters begin from the 4th character of a string, you can use below formula:

=MID(B15,4,3)

B15 is the cell you extract characters from, 4 represent extract characters from 4th character (count from left), 3 is the number of characters you want to extract.

Press Enter key to get the extracted result. Then drag fill handle over the cells to apply this formula.
How to extract part of text string from cell in Excel? (4)

Note:

If you want to move the extracted results to another location, please copy and paste the extracted results as value firstly.

Method B: Extract substring from left, mid or right by Kutools for Excel

If you are not familiar with formulas, you can try Kutools for Excel’s Extract Text feature which is easy to handle this job.

Before using the Extract Text utility, please take 3 minutes to free install Kutools for Excel: 30-day free trial">Free Download Now!

1. Select the cells that you want to extract substrings from, click Kutools > Text > Extract Text.
How to extract part of text string from cell in Excel? (5)

2. In the popping Extract Text dialog, under the Extract by location tab, the first three options support you to extract substring from left, mid or right.
How to extract part of text string from cell in Excel? (6)

The first N character: extract substring from left. For instance, extract first 2 characters, check this option and type 2 into textbox.
How to extract part of text string from cell in Excel? (7)

The last N character: extract substring from right of the string. For instance, extract last 2 characters, check this option and type 2 into textbox.
How to extract part of text string from cell in Excel? (8)

Start to end characters: extract specific number of characters from middle for string. For instance, extract from 4th character to 9th character, check this option and type 4 and 9 into textboxes separately.
How to extract part of text string from cell in Excel? (9)

Insert as a formula: check this checkbox, the result is a formula which can be changed as the original string change, otherwise, the result is fixed.

3. After specifying the location as you need, click Ok, a dialog pops out to select a cell to place the extracted substring. Click OK.
How to extract part of text string from cell in Excel? (10)

Now the substring has been extracted.
How to extract part of text string from cell in Excel? (11)

Extract substring after or before a specified character

If you want to extract substring after or before a specified character, you can apply one of below methods to handle the job.

Method A: Extract substring after or before a defined character by using formula

Supposing you want to extract characters after the character “-” from a list of strings, please use this formula:

=RIGHT(B3,LEN(B3)-SEARCH("-", B3))

B3 is the cell you want to extract characters from, - is the character you want to extract string after.

Press Enter key to get the extracted result. Then drag fill handle over the cells to apply this formula.
How to extract part of text string from cell in Excel? (12)

If you want to extract substring before a defined character, you can use the formula like this:

=LEFT(B10,SEARCH("-", B10)-1)

Example result is shown as below:
How to extract part of text string from cell in Excel? (13)

Note

The data may be lost or changed while you copy and paste the formula results to another location. For preventing this problem from happening, you can copy and paste the formula results as value after applying the formula. Or you can try the Method B.
How to extract part of text string from cell in Excel? (14)

Method B: Extract substring after or before a defined character by Kutools for Excel

For directly extract substring after or before a specified character, you can use the Extract Text utility of Kutools for Excel, which can help you to extract all characters after or before a character, also can extract specific length of characters before or after a character.

Before using the Extract Text utility, please take 3 minutes to free install Kutools for Excel: 30-day free trial">Free Download Now!

1. Select the cells that you want to extract characters, click Kutools > Text > Extract Text.
How to extract part of text string from cell in Excel? (15)

2. In the popping Extract Text dialog, under Extract by location tab, go to the before the text and after the text options to specify the setting as you need..
How to extract part of text string from cell in Excel? (16)

Before the text: extract substrings before the entered character(s). For instance, type – into the textbox, all characters before – will be extracted.
How to extract part of text string from cell in Excel? (17)

After the text: extract substrings after the entered character(s). For instance, type – into the textbox, all characters after – will be extracted.
How to extract part of text string from cell in Excel? (18)

Insert as a formula: check this checkbox, the result is a formula which can be changed as the original string change, otherwise, the result is fixed.

3. Click Ok, a dialog pops out to select a cell to place the extracted substring. Click OK.
How to extract part of text string from cell in Excel? (19)

Now the string before or after the certain character(s) has been extracted.
How to extract part of text string from cell in Excel? (20)

How to extract part of text string from cell in Excel? (21)

13 Text tools You Must Have in Excel Which Will Boot Your Efficiency By 90%

▲ Batch edit text string in cells, such as adding same text to cells at once, remove characters at any position and so on.

▲ Except tools displayed in picture, there are 300 advanced tools else in Kutools for Excel, which can solve your 82% Excel puzzles.

▲ Become an Excel expert in 5 minutes, gain people's recognition and promotion.

▲ 110000+ high efficiency people sand 300+ world renowned companies' choice.

30-days free trial, no credit card require

Extract substring between two characters

Maybe in some cases, you need to extract substring between two characters, you can choose one of below methods to handle the job.

Method A: Extract by formula

Supposing to extract characters between brackets () from a given list, you can use below formula:

=MID(LEFT(B3,FIND(")",B3)-1),FIND("(",B3)+1,LEN(B3))

In the formula, B3 is the cell that you want to extract string from, ( and ) are the two characters you want to extract string between.

Press Enter key to get the extracted result. Then drag fill handle over the cells to apply this formula.
How to extract part of text string from cell in Excel? (22)

Note

If the formula is a little difficult for you, you can try the Method B, which is using a handy tool to quickly solve this problem.

Method B: Extract by Kutools for Excel

In Kutools for Excel’s hundreds of features, there is a feature – Extract strings between specified text can quickly extract substrings between two characters.

Before using the Extract Text utility, please take 3 minutes to free install Kutools for Excel: 30-day free trial">Free Download Now!

1. Select a cell that used to place the extracted substring, click Kutools > Formula Helper > Text > Extract strings between specified text.
How to extract part of text string from cell in Excel? (23)

2. In the Formulas Helper dialog, go to the Arguments input section, then select or directly type the cell reference and the two characters you want to extract between.

In default, when you select the cell reference which used to extract substring, the cell reference will be absolute which cannot use the auto fill handle to fill formula, please change it to relative.
How to extract part of text string from cell in Excel? (24)

3. Click Ok, now the first result has been gotten, then drag auto fill handle over cells that need this formula.
How to extract part of text string from cell in Excel? (25)

Tip:

If you want to extract strings between two characters (including the two characters), the Extract Text utility of Kutools for Excel also can do you a favor on this operation.

1. Select the cells that you want to extract substring between characters, click Kutools > Text > Extract Text.
How to extract part of text string from cell in Excel? (26)

2.In the popping Extract Text dialog, under Extract by rule tab, go to the Text section, type the characters that you want to extract string between, and the string can be repented by the wildcard *. If you want to extract string with fixed length, the wildcard ? can be used, one ? indicate one character.

Then click Add to add the rule to the Rule description section.
How to extract part of text string from cell in Excel? (27)

3.Click Ok, a dialog pops out to select a cell to place the extracted substring. Click OK.
How to extract part of text string from cell in Excel? (28)

Now the string between two certain characters has been extracted.
How to extract part of text string from cell in Excel? (29)

Extract E-mail address from a string

If you want to extract e-mail address from a given string or a range of cells, you can use the Extract Email Address function to handle this job at once time instead of finding them one by one.

Before using the Extract Email Address utility, please take 3 minutes to free install Kutools for Excel: 30-day free trial">Free Download Now!

1. Select the cells that will be extracted email address, then click Kutools > Text > Extract Email Address.
How to extract part of text string from cell in Excel? (30)

2. Then a dialog pops out for you selecting a cell to output the address emails.
How to extract part of text string from cell in Excel? (31)

3. Click OK, the email addresses in each cell have been extracted.
How to extract part of text string from cell in Excel? (32)

Extract numeric or alphabetical characters from string

If there is a list of data mixed numeric and alphabetical and special characters, you just want to extract the numbers or alphabetical values, you can try Kutools for Excel’s Remove Characters utility.

1. Before you using the Remove Characters utility, you need to have a copy of the data as below screenshot shown:
How to extract part of text string from cell in Excel? (33)

2. Then select this copy of data, click Kutools > Text > Remove Characters.
How to extract part of text string from cell in Excel? (34)

3. In the Remove Characters dialog, check Non-numeric option, click Ok.
How to extract part of text string from cell in Excel? (35)

Now only the numeric characters have been left.
How to extract part of text string from cell in Excel? (36)

To extract alphabetical values only, check Non-alpha option in the Remove Characters dialog.
How to extract part of text string from cell in Excel? (37)

Download sample file

Click to download this sample file

Other Operations (Articles) Related To File Conversion

Extract time from datetime string
Provides tricks to extract time (hh:mm:ss) or hour/minute/second only from datetime string (mm/dd/yyyy hh:mm:ss)

Extract rows that meet criteria
In this article, it can help you quickly extract these rows that meet criteria to another location in Excel except finding and copying them one by one.

Extract a nth character from string
Here will introduce the methods on extracting the nth character from a string, for example, extract the 3th character from string a1b2c3, the result is b.

Extract substring between two characters
Show the methods on extracting substring between two same or different characters.

The Best Office Productivity Tools

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

  • 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 and Keeping Data; Split Cells Content; Combine Duplicate Rows and Sum/Average... 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...
  • Favorite and Quickly Insert Formulas, Ranges, Charts and Pictures; Encrypt Cells with password; Create Mailing List and send emails...
  • 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...
  • Pivot Table Grouping by week number, day of week and more... Show Unlocked, Locked Cells by different colors; Highlight Cells That Have Formula/Name...

How to extract part of text string from cell in Excel? (39)

Read More... Full Features 30-Day Free Trial... Purchase...

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!

How to extract part of text string from cell in Excel? (40)

Read More... Full Features 30-Day Free Trial... Purchase...

FAQs

How do I extract a partial text from a cell in Excel? ›

How to extract a substring in Excel
  1. Use the LEFT, RIGHT and MID functions. You can use the LEFT, RIGHT and MID functions to extract specific text from a cell. ...
  2. Use the TRIM function. Sometimes, instead of wanting to remove text from a string, you want to remove spaces. ...
  3. Use the MID and FIND functions. ...
  4. Use Flash Fill.
Dec 14, 2021

How do I extract certain words from a cell in Excel? ›

=LEFT(B1,2) to extract the first 2 characters of the cell B1. =RIGHT(B1,8) to extract the last 8 characters of the cell B1. =MID(B1,4,2) to extract the 2 characters following the 4th character in B1. To apply the changes to the cells below, drag down the blue square.

How do I find part of a text string in Excel? ›

To locate a substring of a given length within any text string, use Excel FIND or Excel SEARCH in combination with the MID function.

How do I extract text from text string in Excel? ›

Step 1: Open Excel. Step 2: Type any alphanumeric string in cell “B5” (eg. geeksId345768). Step 5: Type the function name “=onlyText(B5)” in cell “C5”.

How do you pull cells that contain specific text? ›

Find cells that contain text
  1. Select the range of cells that you want to search. ...
  2. On the Home tab, in the Editing group, click Find & Select, and then click Find.
  3. In the Find what box, enter the text—or numbers—that you need to find.

How do I extract text from the middle of a string in Excel? ›

The Excel MID function extracts a given number of characters from the middle of a supplied text string. For example, =MID("apple",2,3) returns "ppl".

How do I extract specific text from a cell in sheets? ›

How Do I Extract Specific Text From a Cell in Google Sheets? You can use LEFT + SEARCH in Google Sheets to extract text from a string or to extract data that comes before a specific text. LEFT is used to return a specific number of characters from the leftmost cell's beginning.

Which method is used to retrieve string value of a particular cell? ›

You can use the GetCellValue method to retrieve the value of a cell in a workbook. The method requires the following three parameters: A string that contains the name of the document to examine.

How do you extract a part of a string in a string? ›

The substr() method extracts a part of a string. The substr() method begins at a specified position, and returns a specified number of characters. The substr() method does not change the original string. To extract characters from the end of the string, use a negative start position.

How do I extract a number from the middle of a text string? ›

Select all cells with the source strings. On the Extract tool's pane, select the Extract numbers radio button. Depending on whether you want the results to be formulas or values, select the Insert as formula box or leave it unselected (default).

How do I extract information from text data? ›

6 NLP Techniques for Extracting Information from Unstructured Text
  1. Sentiment Analysis. Sentiment analysis (also known as opinion mining) is an NLP text extraction technique to find out the tone of the given data. ...
  2. Named Entity Recognition. ...
  3. Topic Modeling. ...
  4. Summarization. ...
  5. Text Classification. ...
  6. Dependency Graph.
Sep 30, 2022

How do I filter data containing specific text in Excel? ›

Filter for specific text
  1. Click a cell in the range or table that you want to filter.
  2. On the Data tab, click Filter .
  3. Click the arrow. ...
  4. Under Filter, click Choose One, and then in the pop-up menu, do one of the following: ...
  5. In the box next to the pop-up menu, enter the text that you want to use.

How do I select text between characters in Excel? ›

In Excel 365, you can get text between characters more easily by using the TEXTBEFORE and TEXTAFTER functions together. This formula also works nicely for extracting text between two occurrences of the same character. By default, both the TEXTAFTER and TEXTBEFORE functions are case-sensitive.

How do I pull specific data from Google Sheets? ›

Just select a column (or a range of cells within a column) where you want to pull out data from and expand one of the groups based on your task.
...
Start the add-on
  1. Run Power Tools from the Google Sheets menu: Extensions > Power Tools > Start:
  2. Go to the Text group:
  3. Find and click the Extract icon:

How do you pull data from a cell in Google Sheets? ›

Get data from other sheets in your spreadsheet
  1. On your computer, go to docs.google.com/spreadsheets/.
  2. Open or create a sheet.
  3. Select a cell.
  4. Type = followed by the sheet name, an exclamation point, and the cell being copied. For example, =Sheet1! A1 or ='Sheet number two'! B4 .

How do I extract specific data from a spreadsheet? ›

To pull data from another sheet by using cell references in Excel:
  1. Click in the cell where you want the pulled data to appear.
  2. Type = (equals sign) followed by the name of the sheet you want to pull data from. ...
  3. Type ! ...
  4. Press Enter.
  5. The value from your other sheet will now appear in the cell.
May 20, 2022

References

Top Articles
Latest Posts
Article information

Author: Carlyn Walter

Last Updated: 04/11/2023

Views: 5908

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.