Skip to main content

Extract text between parentheses from text string

If there is part of the text surrounded with the parentheses within the text string, now, you need to extract all the text strings between the parentheses as following screenshot shown. How could you solve this task in Excel quickly and easily?

Extract text between parentheses from text string in Excel

To extract the data between parentheses, first, you should find the location of left and right parenthesis by using the SEARCH function, and then apply Mid Function to get the result. The generic syntax is:

  • text: The text string or cell value that you want to extract data from.

Please enter or copy the below formula into a blank cell:


Then, drag this formula to other cells that you want to apply this formula, and all texts between the parentheses have been extracted, see screenshot:

Explanation of the formula:
  • 1. SEARCH("(",A2)+1: This SEARCH function returns the position of the first left parentheses character in cell A2, and add 1 to get the position of the first character inside the parentheses. This part is recognized as the start_num argument in the MID function.
  • 2. SEARCH(")",A2)-SEARCH("(",A2)-1:
  • SEARCH(")",A2): This part of the formula returns the position of the first right parentheses character in cell A2.
  • SEARCH(")",A2)-SEARCH("(",A2)-1: The position of the right parentheses subtracts the position of the left parentheses to get the number of the characters between the parentheses that need to be extracted. And this returned value will be recognized as the num_chars argument in the MID function.
  • 3. MID(A2,SEARCH("(",A2)+1,SEARCH(")",A2)-SEARCH("(",A2)-1): So far, the MID function is used to extract the text inside the parentheses.

Note: If there are multiple parentheses in a cell, to extract all the substrings from the parentheses, you should apply the following formula:

=TRIM(MID(SUBSTITUTE(SUBSTITUTE("("&$A2,"(",")"),")",REPT(" ",LEN($A2))),2*LEN($A2)*(COLUMNS($A:A)),LEN($A2)))

Then, drag this formula to right cells to get all strings between the parentheses from a cell, see screenshot:

Keep on dragging the fill handle down to the range of cells that you want to apply this formula, and all texts between all parentheses have been extracted at once, see screenshot:

Relative functions used:

  • MID:
  • The MID function returns the specific characters from the middle of text string.
  • The SEARCH function can help you to find the position of a specific character or substring from the given text.

More articles:

  • Extract Word Which Containing Specific Text In Excel
  • Sometimes, you may want to extract the word from a cell that contains a specific character or text, such as following screenshot shown, to extract all words that containing the “=” character. How could you solve this task in Excel?

The Best Office Productivity Tools

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi there,

This was brilliant, thank you! I had tried more than 20 other formulas to remove multiple parentheses and split out the numbers contained, all without success.

Question though, this only appears to work where the cell of origin has <500 characters approx.
Any idea how I could expand this?

I am currently manually splitting the larger cells and then recombining, it only accounts for approx. 10% of my workload, but would be great if there is an automated/formulaic solution! :)

Cheers, 0
This comment was minimized by the moderator on the site
I have tested, the second formula in this article can work well if the cell contains more than 500 characters.
=TRIM(MID(SUBSTITUTE(SUBSTITUTE("("&$A2,"(",")"),")",REPT(" ",LEN($A2))),2*LEN($A2)*(COLUMNS($A:A)),LEN($A2)))

Please have a try, if you have any other problem, please upload an error screenshot here.
Thank you!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations