Home > Net >  Remove everything from a cell thats within <> in Google Sheets
Remove everything from a cell thats within <> in Google Sheets

Time:05-23

I know there are a lot of topics about removing characters from Google Sheets cells. I've tried to find a way how to solve my issue with the information on the web / stackoverflow but I can't find it...

I need to create a column with text in multiple rows. The original file still has styling codes <p> <strong> <i> etc in it. I need to remove these styling codes. So actually every <> code should be removed from the cell. I tried to do this with substitute but than I can only say f.e. remove <p> and I'm still having the other styling codes in the sheet.

I think this could be done with REGEXREPLACE but I cant get it working. I hope that someone can help me to understand how I can get this working. Thank you!

Overview of things to get rid of

CodePudding user response:

use:

=ARRAYFORMULA(REGEXREPLACE(D2:D, "<.*?>", ))

in some cases that wont be enough so:

=ARRAYFORMULA(REGEXREPLACE(D2:D, "<\/\w >|<\w .*?>", ))

and in some cases even that wont be enough so:

=ARRAYFORMULA(REGEXREPLACE(D2:D, "</?\S [^<>]*>", ))
  • Related