Get instant live expert help with Excel or Google Sheets
“My Excelchat expert helped me in less than 20 minutes, saving me what would have been 5 hours of work!”

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.

Strip protocol and trailing slash from URL

If you have a URL and want to find a double slash (“//”) and remove the protocol (https://) from it, you will use a formula that combines the MID, FIND and LEN functions. Throughout the article, we will provide you with a complete guide to using this formula.

Strip protocol and trailing slash from URL

Using the “Strip Protocol and Slash in URL” technique, we can remove selected part of any URL. That is, we remove the protocol for any given link (“HTTP://”).

Formula

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

Explanation                      

Strip protocol and trailing slash from URL uses the following arguments:

URL: URL is the link of the website.

FIND: FIND locates a double slash (“//”) in the URL and displays its position as a number.

LEN: The LEN function calculates the length of the original URL, subtracting the position of “//” minus 1 from it.

RIGHT: The RIGHT function is used to extract the last character compared to a single slash (“/”).

Example 1

In the given example, the formula in C4 is:

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

The heart of this formula is the MID function, which takes out the text in the link, starting with the character after a double slash (“//”) and ending at the character before the trailing slash (“/”)

=MID(URL, start, chars)

In this example, the URL is coming from B4.

The start of the URL is calculated by the FIND function:

=FIND("//",B4)+2

Here FIND function is returning the position of “//” as a number in the link, to start extracting from the next character 2 is added in the FIND function.

=LEN(B5)-FIND("//",B5)-1-(RIGHT(B5)="/")

Figure1. Example of Strip protocol and trailing slash from URL

Here the function RIGHT extracts the last character compared to a single slash (“/”).

 

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Solution examples
I have text and number in multiple cells (Ex: Cell 1: 4S, Cell 2: 3.5A, Cell 3: 8O) and want to sum the number values only (Ex: 4 + 3.5 + 8). How can I do this?
Solved by O. A. in 60 mins
Can you re edit this formula for me =IFERROR(IF(LEN(MID("RHS",1,FIND("RHS",B4,1)))=1,LEFT(B4,3),MID("RHS",1,FIND("RHS",B4,1))),MID("LHS",1,FIND("LHS",B4,1)))
Solved by S. L. in 40 mins
I am having issues creating the one way data table to show the means and standard deviations when you change the proportion of portfolio 1. I have the mean formula and the standard deviation formula at the top and -1 through 1 down the left side. I highlight all of it and create a data table. I reference the "proportion of portfolio 1" cell in the column input box but when the data table comes out it has all the same numbers all they way down the table.
Solved by G. Q. in 49 mins
I have 2 columns one of them with a dropdown list of 20 and the other one with 2 options only. I want that when Comment A and B are chosen in the first column then the secon column populate "X" STRAIGHT AWAY. HOW DO i DO IT?
Solved by I. D. in 10 mins
What formula do I use to create a running balance across several worksheets as the numbers continue to change? For example. I have created a drop down list for every month of the year from Jan - Dec for people to sign up for sessions. As they sign up for sessions, I want to create a list beside their names to show how many sessions they have signed up for. So if they sign up for 6 the summary should automatically display 6, if they sign up for 1 more it would instantly show 7 and so on for each person? Make sense
Solved by C. F. in 59 mins

Leave a Comment

avatar

Subscribe to Excelchat.co

Get updates on helpful Excel topics

Subscribe to Excelchat.co

Did this post not answer your question?
Get a solution from connecting with the expert

Another blog reader asked this question today on Excelchat:

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.
Trusted by people who work at
Amazon.com, Inc
Facebook, Inc
Accenture PLC
Siemens AG
Macy's
The Allstate Corporation
United Parcel Service
Dell Inc