Home > Back-end >  Extract string before last comma in google sheet
Extract string before last comma in google sheet

Time:09-16

I want to extract the whole string before the last comma. Please check the below example.

Example: A1= Mon, this is a test, Wed, Sun, Sat, 2001 world

The result should be: B1 = Mon, this is a test, Wed, Sun, Sat

Thanks in advance. Vineet

CodePudding user response:

We can use a regex replacement here:

REGEXREPLACE(A1, ",[^,]*$", "")

CodePudding user response:

use:

=REGEXEXTRACT(A1; "(.*),")

enter image description here

  • Related