+ Reply to Thread
Results 1 to 6 of 6

Extract domain from URL?

  1. #1
    Registered User
    Join Date
    01-15-2009
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Extract domain from URL?

    Hello,

    I have a string variable which is dynamically populated with a URL value. Some examples of the URL are:

    http://cartoondoor.blogbus.com/index_5.html
    http://asirir.blogspot.com/
    http://neuronets.chat.ru/appendix.html

    I'd like to be able to extract the domain--meaning the string value between // and /.

    I've been struggling with this but can't seem to get it right. Any ideas?

    Please Login or Register  to view this content.
    Many thanks,
    J
    Last edited by gnome_core; 01-27-2009 at 02:51 PM.

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Re: Extract domain from URL?

    Hi

    Perhaps:

    Please Login or Register  to view this content.
    Richard
    Richard Schollar
    Microsoft MVP - Excel

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Extract domain from URL?

    Try something to the effect of:

    =MID(query,instr("//",query)+2,instr("/",MID(query,instr("//",query)+2))-1)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    09-27-2012
    Location
    Earth
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Extract domain from URL?

    I tried to use the code and get a error when using the word "query"...
    Trying to use the code in Excel 2007 to extract a domain name from a string between the "//" and "/" if they exist.


    I am very new to Excel, so this is confusing for me. I am not using SQL, just to Visual Basic Code, so I think that is the problem.

    I'm trying to extract from one column and put just the domain name into another column.
    Last edited by retardlike69; 10-10-2012 at 04:43 AM.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Extract domain from URL?

    Please start a new thread with your question. You can add a link to this thread if you find it relevant.

  6. #6
    Registered User
    Join Date
    09-27-2012
    Location
    Earth
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Extract domain from URL?

    OK, NBVC.

    The new thread was started here for anyone searching for it:
    http://www.excelforum.com/excel-form...el-2007-a.html

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1