Skip to main content

Extract relative path from URL

  • March 31, 2020
  • 1 reply
  • 26 views

Forum|alt.badge.img+4

I would like to create a formula that could extract relative path from a full URL.
Example:

Column 1
domain1/landing-url-1
domain2/landing-url-2
domain3/landing-url-3
domain4/landing-url-4

Relative path:
/landing-url-1
/landing-url-2
/landing-url-3
/landing-url-4

TRIM(MID({Column 1},SEARCH(“domain1”,{Column 1})+LEN(“domain1”),255))

I managed to create the formula that could extract from a particular domain, but I have 4 different types of domain in column 1. How can I combine them into one?

1 reply

Forum|alt.badge.img+4
  • Author
  • New Participant
  • March 31, 2020

Ok, I found the way.

=RIGHT(Column 1,LEN(Column 1)-FIND("/",Column 1,FIND("//",Column 1)+2)+1)