Home > Enterprise >  How to remove a piece of text from a cell?
How to remove a piece of text from a cell?

Time:08-05

I'm trying to remove a piece of text (Perfomance) from a column in Google Spreadsheet that contains (XX Performance) XX is a number like 89. I'm using:

=REGEXREPLACE(D:D, " Performance "," - ")

But no love...

enter image description here

CodePudding user response:

You can use the expression \D :

  • \D matches any character that's not a digit (equivalent to [^0-9])
  • matches the previous token between one and unlimited times, as many times as possible, giving back as needed

The formula will be like:

=REGEXREPLACE(D:D, "\D ","")

UPDATE

I did put it in another column otherwise it creates a circular dependency. The data is imported via API from another app.

Then you will need to create another sheet or use a hidden column to put that information and then use the regex on the column you want the final result.

  • Related