Extract Text Outside of Brackets

  • Thread starter Thread starter willik
  • Start date Start date
W

willik

I want to extract all text inside a cell except for what is in brackets
[ DO NOT DELETE THIS TEXT WITHIN BRACKETS ] as shown here.

I am experimenting with functions like

=MID(A3,FIND("[",A3,1),100)

This returns

[ DO NOT DELETE THIS TEXT WITHIN BRACKETS ] as shown here.

but does not extract the "as shown here". I have many variations of
text within brackets, so the function has to detemine the length with
respect to the brackets.

Any help will be appreciated. Thank you.
 
Hi
if you have only one textpart within brackets for each cell you may try
=LEFT(A1,FIND("[",A1)-1) & MID(A1,FIND("]",A1)+1,1024)
to get everything except the bracket text part
use
=MID(A1,FIND("[",A1),FIND("]",A1)-FIND("[",A1)+1)
to get the text within brackets

Frank
 
This will extract what's in the brackets

=TRIM(LEFT(MID(A1,FIND("[",A1)+1,255),FIND("]",MID(A1,FIND("[",A1)+1,255))-1
))

if you want what's outside of the brackets

=SUBSTITUTE(A1,LEFT(MID(A1,FIND("[",A1),255),FIND("]",MID(A1,FIND("[",A1)+1,
255))+1),"")
 
To: Frank Kabel & Peo Sjoblom

WOW ! Both of these solutions work great.

Thank you for the help.

Regards
 
Back
Top