Forum Discussion

Zdenek_Moravec's avatar
Zdenek_Moravec
Brass Contributor
Oct 27, 2024
Solved

How to extract multiple occurrences of a text enclosed between two same characters

Dear colleagues, I have a cell with plenty of text. Some part of the text is enclosed between tags >> and <<. The task is to extract all these strings to one cell, separated by new line. Notes ...
  • HansVogelaar's avatar
    HansVogelaar
    Oct 28, 2024

    Zdenek_Moravec 

    I hope this works for you (with the text in A5):

     

    =LET(w, TEXTSPLIT(A5, "!"), n, COUNTA(w), s, SEQUENCE(, n), f, FILTER(w, ISEVEN(s)), TEXTJOIN(CHAR(10), TRUE, f))

Resources