Home > Net >  Trying to remove quotation marks and dashes when using the REGEXREPLACE formula in GOOGLE SHEETS. I
Trying to remove quotation marks and dashes when using the REGEXREPLACE formula in GOOGLE SHEETS. I

Time:11-29

I am trying to remove any quotation marks and dashes and replace them with a space in Column D. I have an existing formula for REGEXREPLACE that is copying over everything from Column C. I am wanting to keep that the same while at the same time removing the quotation marks and dashes in Column D when everything is copied over. I think another formula is going to have be written into my existing one but not entirely sure.

Forumula: =regexreplace(C3:C40001,"([^()]*)","")

I tried to use the SUBSTITUTE and REGEXP_REPLACE formula within the REGEXREPLACE formula but kept getting an error.

enter image description here

CodePudding user response:

EDIT: use this formula to trim spaces and parenthesis

=ARRAYFORMULA(TRIM(REGEXREPLACE(C3:C400,"\-|\'|\,|\(|\)|\"""," ")))

You could use something like this:

=ARRAYFORMULA(REGEXREPLACE(C3:C40000,"-|'|\"""," "))

This replaced - ' and " you can also add more characters by adding this symbol: |

If it is a special character from Regex you should preceed it with this slash \

  • Related