Text
Strip HTML tags from text with a single formula (TEXTSPLIT + FILTER)
Extract text from simple balanced angle-bracket markup with TEXTSPLIT and FILTER; learn the limitations of this formula approach.
Split simple markup into alternating tokens
CMS and Shopify product exports often contain dozens of unpredictable HTML tags (<div class="promo">, <a href="...">, <br/>) that cannot be listed in manual SUBSTITUTE formulas.
For the constrained markup shown here, prefix a guard character and split on angle brackets while retaining empty tokens. Odd positions contain text and even positions contain tag material. Join the odd tokens and remove the guard; the limitations below are essential.
| Raw HTML Export (A) | Clean Plain Text |
|---|---|
| <p>Price: <b>$49.00</b></p> | Price: $49.00 |
| <a href="/pro">Upgrade <i>now</i></a>! | Upgrade now! |
| Plain text without tags | Plain text without tags |
Formula for simple balanced markup
This example assumes balanced delimiters with no angle brackets inside attributes or content.
=TRIM(MID(LET(p, TEXTSPLIT("~" & A2, {"<",">"}), k, SEQUENCE(1, COLUMNS(p)), TEXTJOIN("", TRUE, FILTER(p, (-1)^k < 0, ""))), 2, LEN(A2)))Detect the presence of both angle brackets
Returns TRUE when both < and > appear in the string.
=AND(ISNUMBER(FIND("<", A2)), ISNUMBER(FIND(">", A2)))Inputs and interpretation
This is not an HTML parser or sanitizer. Quoted angle brackets, comments, scripts, malformed markup and literal comparison signs can break the alternation. Script text remains, entities are not decoded, and adjacent blocks or br tags can join words without spaces. Render the result as text; use a proper parser and appropriate sanitization for general HTML.
Try the example
Use the original values or change them to test your understanding.