Extract text between brackets using google spreadsheets
13,401
You have regular brackets so use:
=REGEXEXTRACT(X3,"\((.*)\)")
Or change your formula to
=MID(X3,FIND("(",X3)+1,FIND(")",X3)-FIND("(",X3)-1)
If you have both ()
and []
in your data you can use:
=REGEXEXTRACT(X3,"[\[\(](.*)[\)\]]")
Author by
cwille
Updated on June 08, 2022Comments
-
cwille about 2 years
I want to extract the text between brackets in a cell (X3), but the usual excel formulas give a parse error in google spreadsheets.
For example:
=MID(X3,FIND("[",X3)+1,FIND("]",X3)-FIND("[",X3)-1)
How to fix this parse error?
Thanks in advance.
-
cwille about 7 yearsIt still doesn't work (parse error) A screenshot of my spreadsheet on the link below: drive.google.com/open?id=0B1fiv0AmtbFBQTVKYVF6LThfaGM
-
zipa about 7 years@cwille That is a link for locked drive document.
-
zipa about 7 years@cwille Both formulas work, the problem might be in
X3
-
cwille about 7 yearssorry, this is the public link: drive.google.com/file/d/0B1fiv0AmtbFBQTVKYVF6LThfaGM/…
-
zipa about 7 yearsYour brackets aren't
[]
they are()
-
roadsunknown over 5 years@zipa Super weak at Regex, if I wanted just
[]
, what would the regex be?