Share via

EXTRACT TEXT OF SPECIFIC PATTERN FROM EXCEL CELL

Anonymous
2024-05-20T06:16:51+00:00

I Have a column of cell containing below type of text with regular pattern but not fixed number of brackets, i just want to extract all text within [ ] with brackets i.e., [VOMITING] [NAUSEA] [DIZZINESS] [OFF LABEL USE],

can anyone help with the formula

Nausea and vomiting [VOMITING] <br> <br>N / N / Y <br> <br>Nausea and vomiting [NAUSEA] <br> <br>N / N / Y <br> <br>Dizziness [DIZZINESS] <br> <br>N / N / Y <br> <br>Duloxetine used for fibromyalgia [OFF LABEL USE] <br> <br>N / Y / Y
Microsoft 365 and Office | Excel | For education | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. Anonymous
    2024-05-20T08:13:13+00:00

    ="["&TEXTJOIN("] [",,TEXTSPLIT(TEXTSPLIT(TEXTAFTER(A2,"["),,"["),"]"))&"]"

    1 person found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Ashish Mathur 101.8K Reputation points Volunteer Moderator
    2024-05-20T23:58:25+00:00

    Hi,

    In cell B2, enter this formula

    =TEXTJOIN(" ",TRUE,REDUCE("",SEQUENCE(INT(COUNTA(TEXTSPLIT(A2,{"[","]"}))/2),,2,2),LAMBDA(a,i,VSTACK(a,"["&INDEX(TEXTSPLIT(A2,{"[","]"}),,i)&"]"))))

    0 comments No comments
  2. Anonymous
    2024-05-20T12:10:27+00:00

    You are welcome:) You may also give feedback on it.

    0 comments No comments
  3. Anonymous
    2024-05-20T08:28:59+00:00

    Dear Sir/ma'am,

    Thank you so much for your help. i can extract text with this equation.

    0 comments No comments