Extract string before last comma in google sheet

Viewed 23

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

2 Answers

We can use a regex replacement here:

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

use:

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

enter image description here

Related