FormulaCraft

How to get the text between two characters in Excel and Google Sheets

Topic:Text manipulation

Heads up: Excel and Google Sheets do this differently.

Excel
=MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1)
Google Sheets
=REGEXEXTRACT(A2,"\((.+?)\)")

Verified example

Computed by a real spreadsheet engine on the sample data below.

Raw TextBetween
Code (ABC) here
Tag (XYZ) end
ID (123) ok
Ref (QQQ) x
Val (ZZZ) done

=MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1)ABC

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1In Excel, enter =MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1) — the first FIND finds the opening delimiter, the second finds the closing one, and MID extracts what's between.
  2. 2In Google Sheets, use =REGEXEXTRACT(A2,"\((.+?)\)") which captures the group between the parentheses directly.
  3. 3Adjust the delimiter characters to match your data (brackets, quotes, pipes, etc.).
  4. 4Wrap in IFERROR to gracefully handle cells that don't contain both delimiters.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

What if there are multiple pairs of delimiters in the same cell?

The formula extracts only the first match. Use multiple formulas or REGEXEXTRACT with different patterns to capture additional matches.

Does this work with square brackets or curly braces?

Yes — replace ( and ) with [ and ] or { and } in both the FIND arguments and the regex pattern (remember to escape [ and ] in regex: \[ and \]).

More on Text manipulation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: