Hanna
Hanna

Reputation: 135

Removing the part of the url from the last slash (Google Sheets)

I have a big list of urls. For example,

https://www.example.com/category1/product1/

https://www.example.com/en/category2/product-123/

https://www.example.com/de/category456/product-12-13/

I would need to get only the last part of each url without slashes:

product1

product-123

product-12-13

Will really appreciate it for helping with the formula.

Upvotes: 2

Views: 2647

Answers (1)

JPV
JPV

Reputation: 27262

Assuming the url's in column A, try

=Arrayformula(if(len(A2:A), REGEXEXTRACT(A2:A, ".*/(.*?)/$"),))

and see if that works?

Example

Upvotes: 3

Related Questions