AI Content Creation

How to Extract Text Between Two Characters in Google Sheets

The value you want sits between two brackets. The formula to grab it is three functions deep and it breaks on the first odd row.

By FITS TeamAugust 1, 20263 min read

Log lines, campaign names, and product titles love wrapping the useful part in brackets or parentheses. "Q3 Launch [EMEA] final v2" holds a region you need in its own column.

Sheets can slice a string between two positions. Finding those two positions reliably is the hard part.

The Old Way (MID and FIND)

You find the opening character, find the closing one, and take everything in between.

=MID(A2, FIND("[", A2) + 1, FIND("]", A2) - FIND("[", A2) - 1)

It reads fine and it works on the sample row. Then reality arrives. A row with no brackets throws #VALUE! because FIND has nothing to return. A row with two bracket pairs returns the wrong span, since FIND always reports the first match. The regex version has the same problem in fewer characters.

=IFERROR(REGEXEXTRACT(A2, "\[(.*?)\]"), "")

Change the delimiter to a parenthesis or a quote and you rewrite the escaping. Ask for the second pair instead of the first and you are writing a different formula entirely.

The FITS Way (Just Ask)

With FITS, you say which two characters mark the boundary and what to do when they are missing.

=FITS("Return only the text between the square brackets. If there are no brackets, return blank: " & A2)

No escaping, no error wrapper, no off-by-one on the +1 and -1. Rows without brackets come back blank instead of red.

Because the instruction is a sentence, you can be specific about which pair you meant.

=FITS("Return only the text inside the LAST set of parentheses: " & A2)

Swapping brackets for quotes, dashes, or pipes is a word change, not a rewrite.

When to Use Each

If every row has exactly one bracket pair, MID and FIND cost nothing and run instantly. Reach for =FITS() when delimiters repeat, when some rows lack them entirely, or when the delimiter changes between sources. The neighbouring jobs work the same way: extracting numbers from text, splitting text by delimiter when you want every field at once, and removing text after a character when you only need what comes first. For the full picture, read the guide to automating Google Sheets tasks you used to need regex for.

Stop Counting Characters

FITS puts plain-English AI formulas inside Google Sheets. Name the boundary. Get what is inside it, on every row. Free tier included.