← All how-to recipes

How to extract text between two characters

✓ Verified in LibreOffice 25.8.7.3

Pull out the text between two delimiters — like the part inside parentheses.

The formula

AppFormulaNotes
Excel=MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1)Excel 365 alternative: =TEXTBEFORE(TEXTAFTER(A2,"("),")").
Google Sheets=MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1)Identical; REGEXEXTRACT(A2,"\((.*?)\)") is a Sheets-only shortcut.
LibreOffice Calc=MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1)Identical.

How it works

FIND locates the opening and closing characters; MID then grabs the text starting one position after the "(" for a length equal to the distance between the two delimiters minus one. "Widget (blue) large" yields "blue". Swap the two characters for anything — dashes, brackets, quotes. If the delimiters can appear more than once, the newer TEXTBEFORE/TEXTAFTER pair (or REGEXEXTRACT in Sheets) is easier to control.

Verified, not just documented

We ran =MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned blue — exactly the expected result. Every formula here is confirmed by actually executing it.