How to extract text between parentheses in Excel
Excel formula
=IFERROR(TEXTBEFORE(TEXTAFTER(A2,"("),")"),"")Take what follows "(" and stops at ")": =IFERROR(TEXTBEFORE(TEXTAFTER(A2,"("),")"),""). IFERROR leaves rows without brackets blank.
- Result on the example
- one result per row in
B2, filled down toB7 - Works in
- Microsoft 365 only
- Google Sheets
- Different formula, see below
See it work
The formula is already in B2, filled down to B7. Change any input and the result updates, or edit the formula to experiment.
How it works
TEXTAFTER returns everything after the first "(" and TEXTBEFORE keeps everything before the next ")". Text after the closing bracket, like "- 140 cm", is dropped. "USB-C dock" has no brackets, so the formula errors and IFERROR shows a blank.
In Google Sheets, \(([^)]*)\) matches a bracket, then captures the characters that aren't a closing bracket.
=IFERROR(TEXTBEFORE(TEXTAFTER(A2,"("),")"),"")Result"Black"
A2"Desk lamp (Black)"The value in A2.
TEXTAFTER(A2,"(")"Black)"TEXTAFTER: Text after a delimiter.- text
A2"Desk lamp (Black)" - delimiter
"("
- text
TEXTBEFORE(TEXTAFTER(A2,"("),")")"Black"TEXTBEFORE: Text before a delimiter.- text
TEXTAFTER(A2,"(")"Black)" - delimiter
")"
- text
IFERROR(TEXTBEFORE(TEXTAFTER(A2,"("),")"),"")"Black"IFERROR: Returns a fallback when the value is any error.- value
TEXTBEFORE(TEXTAFTER(A2,"("),")")"Black" - value_if_error
""not used
- value
In Google Sheets
Google Sheets needs a different formula: =IFERROR(REGEXEXTRACT(A2,"\(([^)]*)\)"),""). On the same data it gives the same result. Here it is running in Google Sheets mode.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =IFERROR(MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1),"") | Black, Charcoal grey, Silver… | Works in every version: start after the "(" and take as many characters as lie between the two brackets. |
Common mistakes
- Only the first pair is returned: "Notebook (A5) (Dotted)" gives "A5". For the second pair use
TEXTAFTER(A2,"(",2). - Nested brackets, like "Kit (incl. (2) cables)", stop at the first ")". Use instance -1 on the closing bracket if the outer pair is what you want.
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
B2, extract the text inside the parentheses and fill down to B7. Leave the cell blank when there are none.Questions
How do I extract text between square brackets?
Swap the characters: =TEXTBEFORE(TEXTAFTER(A2,"["),"]").
How do I remove the text in parentheses instead?
Use =TRIM(TEXTBEFORE(A2,"(",,,,A2)&TEXTAFTER(A2,")",,,,"")).
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.