+ Reply to Thread
Results 1 to 11 of 11

Excel 2007 : Look up of a word in a column of URLs and return the URL.

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    4

    Look up of a word in a column of URLs and return the URL.

    Hello Guys
    Thanks for all the great solutions to my problem. This is the first time I've not found the answer to a query. My basic problem is the following:


    I have a document with two tabs. Tab 1 has a column of 300 URLs in the following fashion website.com/category/london-centre/london-centre and website.com/category/bristol-centre/bristol-centre.

    The second tab has a column of new URLs off which I have trimmed off the root domain and category leaving just brighton-centre, manchester-centre.

    In the second tab along the new URLs I want to return the old ones i.e I want Excel to look up machester-centre in tab one and return whatever cell contains the URL with macnhester-centre in it.

    Thank you very much for your help.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Look up of a word in a column of URLs and return the URL.

    Hello there,

    Could you please provide a sample of you worksheet?

    Thanks!

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Look up of a word in a column of URLs and return the URL.

    If the first tab is Sheet1 and the websites are in column A, you can use something like:

    Please Login or Register  to view this content.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Registered User
    Join Date
    05-31-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Look up of a word in a column of URLs and return the URL.

    abousetta: Thank you very much I've tried VLookup for the past hour or so but couldn't make it work for this purpose.

    rvasquez: Here's an attached working sheet. I would like the Old URLs(Sheet1) returned in the New URLs(Sheet2) tab in column C. Cheers
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Look up of a word in a column of URLs and return the URL.

    Have a look at this:

    Lookup table:
    Please Login or Register  to view this content.
    Results table (results):
    Please Login or Register  to view this content.
    Results table (formulas)
    Please Login or Register  to view this content.
    Last edited by abousetta; 05-31-2012 at 09:15 AM.

  6. #6
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Look up of a word in a column of URLs and return the URL.

    Nice job abousetta!

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Look up of a word in a column of URLs and return the URL.

    Thanks @rvasquez

  8. #8
    Registered User
    Join Date
    05-31-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Look up of a word in a column of URLs and return the URL.

    Absolutely wonderful. That was mighty helpful. I'm delighted but also needs to work on advancing my Vlookup knowledge!

    Kind regards

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Look up of a word in a column of URLs and return the URL.

    Hi @ElonMusk,

    Glad it all worked out. If you think about it, the formula is pretty simple. I just used a vlookup and instead of specific lookup value I used two wildcards sandwiching a trimmed down (e.g. no leading or trailing spaces) version of the lookup value. I probably learned this from another thread on this site.

    Good luck.

    abousetta

  10. #10
    Registered User
    Join Date
    05-31-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Look up of a word in a column of URLs and return the URL.

    I use vlookup a lot but never made use of trimming and wildcards. Will search for a few articles that can shed some spotlight on what those parameters are designed for and off course, how they can aid me in slicing and dicing huge sets of data efficiently.

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Look up of a word in a column of URLs and return the URL.

    One of the biggest problems I find with lookup in general is that it looks for an exact value. One extra space here or there will throw it off. Therefore trim removes the leading the trailing spaces. Adding the wildcards in allow you to get a fuzzy approach to vlookup. If you really want to go 'fuzzy' check out Alan's code. Towards the end of the thread he gives the most recent fuzzy vlookup code for the UDF and even has added soundex to it. Good stuff if you really need to get creative.

    Hope this helps.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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