Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cut out substrings of a URL in Google Spreadsheets with different characters?

I want to cut out substrings from this url XY.com/de/haus/dach-ziegel-stein/ and put the values each in its own columns in Google Spreadsheet.
I want to cut out by / and by -.

With this url example:

  • Column A should be de
  • Column B should be haus
  • Column C should be dach
  • Column D should be ziegel
  • Column E should be stein

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use the following single formula for a range

=INDEX(IFERROR(SPLIT(
                 REGEXREPLACE(
                    REGEXREPLACE(A125:A128,"^\w+\.\w+\/"," "),
                         "\/|\-"," ")," ")))

(do adjust ranges and locale according to your needs)

Or simpler

=INDEX(IFERROR(SPLIT(
     REGEXREPLACE(A125:A128,"\w+\.\w+\/"," "),"/|-")))

Functions used:

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading