Extracting text from cell

nn992

New Member
Joined
Jul 28, 2016
Messages
47
Hello guys,

I have large xls file wherein one cell has 100+ words...
Out of that specific cell (J1,J2,j3...) I want to extract content which is in "[ ]" square brackets. The problem is that there is sometimes one pair of brackets in the cells, but sometimes is also 3-4 pairs of brackets...


I managed to extract from first bracket pair, but for other ones, I cant do it.

Hope someone can help. If you need more information, comment please :)

Thanks in advance
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Using a formula:


Book1
JKLMNO
1[a]bc[d]ef[g]hi[j][k]adgjk
Sheet1
Cell Formulas
RangeFormula
K1=IFERROR(MID($J1,FIND(CHAR(1),SUBSTITUTE($J1,"[",CHAR(1),COLUMNS($K1:K1)))+1,FIND(CHAR(1),SUBSTITUTE($J1,"]",CHAR(1),COLUMNS($K1:K1)))-FIND(CHAR(1),SUBSTITUTE($J1,"[",CHAR(1),COLUMNS($K1:K1)))-1),"")


Copy formula in K1 across and down as necessary.

WBD
 
Upvote 0
Hi, and just another option..:


Excel 2013/2016
JKLM
1text [first part] text text text [second] text text [third one]first partsecondthird one
2text [first part] text text text text text [second one]first partsecond one
3text [just one] text text text text textjust one
Sheet1
Cell Formulas
RangeFormula
K1=IFERROR(TRIM(LEFT(SUBSTITUTE(MID($J1,FIND("#",SUBSTITUTE($J1,"[","#",COLUMNS($K1:K1)))+1,255),"]",REPT(" ",255)),255)),"")
 
Upvote 0
Hi guys,

Thanks a lot for the fast ansvers, but unfortunately it doesn't work for me../

it asks me to correct the formula, and instead of '','' to put '';'' , which after correction returns wrong solution (nothing appears) :/
 
Upvote 0
it asks me to correct the formula, and instead of '','' to put '';'' , which after correction returns wrong solution (nothing appears) :/

Can you post the amended formula that you tried?

EDIT: And can you post a few examples of your data in your reply.
 
Last edited:
Upvote 0
Hi guys,

Thanks a lot for the fast ansvers, but unfortunately it doesn't work for me../

it asks me to correct the formula, and instead of '','' to put '';'' , which after correction returns wrong solution (nothing appears) :/
It seems to be specific to your locale where argument separator for formula is ";". So if you replace all "," with ";" then FormR formula should look like:
=IFERROR(TRIM(LEFT(SUBSTITUTE(MID($J1;FIND("#";SUBSTITUTE($J1;"[";"#";COLUMNS($K1:K1)))+1;255);"]";REPT(" ";255));255));"")
 
Upvote 0

Forum statistics

Threads
1,214,878
Messages
6,122,062
Members
449,064
Latest member
scottdog129

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