Spreadsheet Practice

How to extract text between parentheses in Google Sheets

Google Sheets formula

=REGEXEXTRACT(A2,"\(([^)]*)\)")

Capture what's inside the brackets: =REGEXEXTRACT(A2,"\(([^)]*)\)").

Result on the example
one result per row in B2, filled down to B6
Excel
See below

See it work

The formula is already in B2, filled down to B6. Change any input and the result updates, or edit the formula to experiment.

How it works

Brackets have a special meaning in patterns, so the literal ones are escaped: \( and \). Between them, ([^)]*) captures any run of characters that aren't a closing bracket, and REGEXEXTRACT returns just that group.

=REGEXEXTRACT(A2,"\(([^)]*)\)")

Result"Finance"

  1. A2"Ana Ruiz (Finance)"

    The value in A2.

  2. REGEXEXTRACT(A2,"\(([^)]*)\)")"Finance"

    REGEXEXTRACT: The first match, or the captured group(s). #N/A when nothing matches.

    • textA2"Ana Ruiz (Finance)"
    • regular_expression"\(([^)]*)\)"

In Excel

In Excel 2024 or Microsoft 365, nest TEXTAFTER and TEXTBEFORE: =TEXTBEFORE(TEXTAFTER(A2,"("),")").

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=TEXTBEFORE(TEXTAFTER(A2,"("),")")Excel onlyFinance, Sales, IT…The Excel version.
=TRIM(REGEXEXTRACT(A2,"^[^(]+"))Ana Ruiz, Raj Patel, Lee Chen…Different resultThe opposite: the name before the bracket, with the trailing space trimmed. The names: Ana Ruiz, Raj Patel and so on.

Common mistakes

  • Unescaped brackets, "((.*))", are read as groups and return the whole text.
  • With two bracketed parts, this returns the first. Use REGEXEXTRACT with two groups, or SPLIT, to get both.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Extract text between parentheses

In B2, extract the department written in parentheses in A2. Fill down to B6.

Questions

How do I extract text between square brackets?

Escape those instead: =REGEXEXTRACT(A2,"\[([^\]]*)\]").

How do I remove the bracketed part?

Replace it with nothing: =TRIM(REGEXREPLACE(A2,"\([^)]*\)","")).

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine.