Excel Find & Mid functions for variable length strings

microsoft excel

What function can I use to extract variable length strings, where all I know is the beginning and end points of the string.
So for example, I have a large list of domain names formatted like below, and I need to extract everything between the “://” and the “/” that occurs after the “.com”. One condition is that I also have some domain names in the same list that end in “.net” or “.ca” that need to be extracted similarly.

http://store.domain1.com/nn7/buyers.ncx?

http://www.domain2.net/nn6/buyers.ncx?

Best Answer

Use this:

=MID(A1,FIND("//",A1)+2,FIND("/",A1,10)-FIND("//",A1)-2)

enter image description here

Related Question