+ Reply to Thread
Results 1 to 17 of 17

Find Keyword in URL from Lookup Table

  1. #1
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Find Keyword in URL from Lookup Table

    Hi Everyone,

    I've been wracking my head trying to figure this out.

    Scenario (steps)
    1. For a list of URLs in Column A, I need to search that list for a specific keyword
    2. The keyword being searched for is a list/table in Columns B. There will probably be 10 - 15 keywords
    3. In Column C, I need to return the keyword if found. If not, either the cell in Column C is blank or returns "not found"

    Sample URL List
    http://www.groovyclothing.com/cashmere-travel-wrap-750
    http://www.groovyclothing.com/cashme...inge-poncho-98
    http://www.groovyclothing.com/weathe...hmere-scarf-47
    http://www.groovyclothing.com/essent...travel-wrap-22
    http://www.groovyclothing.com/essent...-sweatshirt-69
    http://www.groovyclothing.com/the-la...shmere-shampoo
    http://www.groovyclothing.com/spring...travel-wrap-34

    For example, the keyword is "cashmere" (Column B) and I'm looking to see it is found in the URL list (Column A).

    I'm thinking that a complex formula using SEARCH and FIND might work? But I think the problem in this method is the URL syntax (colon, slashes, dashes) and also that the keyword is not found in the same position in each URL.

    So, just wondering if this can be done by formula or if VBA is required?

    Thanks in advanced!

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Find Keyword in URL from Lookup Table

    What if in http://www.groovyclothing.com/spring...travel-wrap-34 it find three keywords: spring, travel and wrap?
    What you want as output?

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Find Keyword in URL from Lookup Table

    What if in http://www.groovyclothing.com/spring...travel-wrap-34 it find three keywords: spring, travel and wrap?
    What you want as output?

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Find Keyword in URL from Lookup Table

    Will you please attach a sample Excel workbook? Please don't attach a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find Keyword in URL from Lookup Table

    Try this...

    Data in the range A2:An

    Keyword list in the range B2:B10

    Enter this formula in C2 and copy down as needed:

    =IFERROR(LOOKUP(5000,SEARCH(B$2:B$10,A2),B$2:B$10),"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find Keyword in URL from Lookup Table

    P.S.

    You don't have what version of Excel you're using in your profile.

    I've assumed Excel 2007 or later.

  7. #7
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: Find Keyword in URL from Lookup Table

    Thanks for responding, Zbor.

    Ideally, it would list all words found (space separated) by the order that the word is found in the lookup list.

    So if this is the lookup list:
    B1: Cashmere
    B2: Travel
    B3: Wrap

    The output in the cell (Column C) would be: cashmere travel wrap.

    Otherwise, if it's only possible to output 1 word, it would be the 1st word in the list (cashmere)

  8. #8
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: Find Keyword in URL from Lookup Table

    Thanks for responding, Glenn.

    I'm hoping that I attached the file properly
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: Find Keyword in URL from Lookup Table

    Thanks Tony. Unfortunately, the only thing returned to Column C were zeros.

    I am using Office 365 ProPlus.

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find Keyword in URL from Lookup Table

    I looked at your file.

    If you want multiple keywords returned to a single cell it will require a VBA function.

  11. #11
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    A Macro to Find Keyword in URL from Lookup Table

    Hi Everyone,

    I originally posted this in the formulas section, but one of the kind souls that responded said VBA would be required to get my desired output.

    Scenario (steps)
    1. For a list of URLs in Column A, I need to search that list for a specific keyword
    2. The keyword being searched for is a list/table in Columns B. There will probably be 10 - 15 keywords
    3. In Column C, I need to return the keyword if found. If not, either the cell in Column C is blank or returns "not found"

    Ideally, it would list all words found (space separated) by the order that the word is found in the lookup list.

    So if this is the lookup list:
    B1: Cashmere
    B2: Travel
    B3: Wrap

    The output in the cell (Column C) would be: cashmere travel wrap.

    Otherwise, if it's only possible to output 1 word, it would be the 1st word in the list (cashmere)

    Thanks in advanced!
    Attached Files Attached Files

  12. #12
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: A Macro to Find Keyword in URL from Lookup Table

    Maybe :
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  13. #13
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: A Macro to Find Keyword in URL from Lookup Table

    Thanks Karedog! Great work. I really appreciate you for taking the time to put this together. It's 99% of what I was looking for.

    The remaining 1% is that it only works on exact match. It doesn't match singular to plural (you have to put both in to get matches for both). So I'm thinking that it's probably best to set the exact match on singular and have that to include singular and plural forms of the word.

    Is there a way to modify to make this happen.

    Thanks so much again for your help.

  14. #14
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: A Macro to Find Keyword in URL from Lookup Table

    You are welcome.

    That would be need a "database solution" matching work, since there are so many irregular plurals noun (can't be solved by using mathematical algorithm alone).

    For example : (https://en.wikipedia.org/wiki/English_plurals)

    hero --> heroes
    potato --> potatoes

    but :
    zero --> zeros (not zeroes)
    piano --> pianos (not pianoes)

    also many words that totally changed for plural, like foot --> feet

    So I don't think it will be possible without using "database solution".

  15. #15
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Find Keyword in URL from Lookup Table

    Here, I've create UDF called FIND_KEYWORDS.
    Use it as:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Where B3 is http link that you looking for
    C3:C8 is range with your keywords. Of course it can be changed.

    What can't be changed is structure of your B3 link.
    Keywords must be in last word separater by /
    i.e. OK http://www.groovyclothing.com/essential-cashmere-striped-travel-wrap-22
    NOT OK http://www.groovyclothing.com/essent...travel-wrap-22/

    And in that word after last / it will look for - separated words:
    i.e. OK essential-cashmere-striped-travel-wrap-22
    NOT OK essential_cashmere_striped_travel_wrap_22
    Attached Files Attached Files

  16. #16
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: A Macro to Find Keyword in URL from Lookup Table

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules.

    Due to provided solution this thread is now merged with original thread.

  17. #17
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    115

    Re: A Macro to Find Keyword in URL from Lookup Table

    Thanks for the UDF, zbor. It's really good work.

    Sorry about the rules violation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Find if keyword is in the URL (which contains no spaces)
    By ccastell88 in forum Excel General
    Replies: 2
    Last Post: 08-04-2015, 03:24 AM
  2. How to lookup a keyword and list the content? Thanks.
    By jexcelhk in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-20-2014, 02:02 AM
  3. Keyword Lookup in Google and Return URL
    By maddog9486 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2014, 04:13 PM
  4. Replies: 2
    Last Post: 07-13-2012, 04:02 AM
  5. Replies: 2
    Last Post: 01-27-2012, 05:49 AM
  6. Replies: 2
    Last Post: 10-21-2011, 12:04 PM

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