Extract text between MULTIPLE parentheses in one cell

Dunno123

New Member
Joined
Jul 4, 2020
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I would like to extract text between MULTIPLE parentheses in one cell (without using VBA).

The blue text in the picture below is what I'd like to achieve automatically.

asd.png


When there is just one set of parentheses, it's easy. For B1 I could use:
=MID(A1,SEARCH("(",A1)+1,SEARCH(")",A1)-SEARCH("(",A1)-1)

Is there any way I could change this formula to make it work with multiple parentheses as in cell A2?

Thank you in advance for your help.
 
Peter_SSs: Thank you very much for your help, I appreciate it a lot. Your formula works like a charm!
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hello Peter_SSs,

This works like a charm for my case too :

=CONCAT(SUBSTITUTE(MID(SUBSTITUTE(SUBSTITUTE(J2,"]","["),"[",REPT("[",1000)),SEQUENCE(LEN(J2),,,2)*1000,1000),"[",""))

Could we have a way where i could insert a enter after each word ?

Ex:

hello [world] in this [good] human, [place] for [happy] [reason]

Expected is

world
good
place
happy
reason



Please help.

Thanks,
 
Upvote 0
Could we have a way where i could insert a enter after each word ?
Welcome to the MrExcel board!

Sure, just use TEXTJOIN instead of CONCAT. Make sure that you format the result column to 'Wrap Text'

22 02 11.xlsm
JK
2hello [world] in this [good] human, [place] for [happy] [reason]world good place happy reason
TEXTJOIN v CONCAT
Cell Formulas
RangeFormula
K2K2=TEXTJOIN(CHAR(10),1,SUBSTITUTE(MID(SUBSTITUTE(SUBSTITUTE(J2,"]","["),"[",REPT("[",1000)),SEQUENCE(LEN(J2),,,2)*1000,1000),"[",""))
 
Upvote 0
Welcome to the MrExcel board!

Sure, just use TEXTJOIN instead of CONCAT. Make sure that you format the result column to 'Wrap Text'

22 02 11.xlsm
JK
2hello [world] in this [good] human, [place] for [happy] [reason]world good place happy reason
TEXTJOIN v CONCAT
Cell Formulas
RangeFormula
K2K2=TEXTJOIN(CHAR(10),1,SUBSTITUTE(MID(SUBSTITUTE(SUBSTITUTE(J2,"]","["),"[",REPT("[",1000)),SEQUENCE(LEN(J2),,,2)*1000,1000),"[",""))
It Worked very well . You just saved my 2 hours of time. Appreciate your help, i will follow this website . Thank you
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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