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

How to extract a portion of this URL in Google Sheets?

Given this URL: https://drive.google.com/file/d/1pnEX1OQXXXHzu6z9dPV5ZZ5VHqPU--6/view?usp=share_link, how can I extract only what is between d/ and /view?

I’ve tried it using: =MID(A2,SEARCH("d/",A2)+1,SEARCH("/view",A2)-SEARCH("/view",A2)-1)+0, but it doesn’t work.

Here is a practical example, should you feel like killing it

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 Regular Expressions in Google Sheets. The formula

=REGEXEXTRACT("link text here", "d/(.+)/view")

will make the cell value whatever is inside the matching group (whatever is in between "d/" and "/view".

Here is the documentation for Google Sheet’s RegEx commands: https://support.google.com/docs/answer/3098244′

You can learn more about Regular Expressions by playtesting with it here: https://regexr.com/

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