+ Reply to Thread
Results 1 to 11 of 11

Find elements of text in a cell and poss vlookup against a table

  1. #1
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Find elements of text in a cell and poss vlookup against a table

    Hope someone can help me out. I've tried a range of IF, ISNUMBER, & SEARCH but can't seem to get it working. I'm looking to do the following (it's for an Adwords search query report, in case that helps anyone)

    What I'm trying to do is find instances of text keywords within a cell, and then show the category (that I'm creating in a table)

    Example, the cells contain text such as
    "Brand official website"
    "misspelt brand free quote"
    "product A buy online"
    "where can I order product A to deliver free"
    "looking for Product B website"
    "compare prices for Product B"

    I've created another table which will have a column for the Category, and then a column for all instances of the terms (variations and misspellings) that will show for this, so this can be expanded as time goes on (the report will be running over time, so needs the flexibility of a table).

    I've made an example with a mock brand/product to give an example of what I'm trying to do.

    Thanks!

    All I really need at present, is for a formula to run against the cells of text, and then in another column, return ideally the search element it's found, and then the category in another column (if not one or the other can be VLOOKUP'd).

    I'm having trouble trying to strip out the text and return the category. so hoping someone on here is able to help out.

    Thanks!
    Attached Images Attached Images

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Find elements of text in a cell and poss vlookup against a table

    Welcome to the forum!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    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 results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as 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.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Find elements of text in a cell and poss vlookup against a table

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Re: Find elements of text in a cell and poss vlookup against a table

    Thanks all, have attached a mock sheet.

    as a note, ideally I'd have the Category/Keyword table on a seperate tab, but for this example I've just put it in the same tab.

    Thanks
    Attached Files Attached Files

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Find elements of text in a cell and poss vlookup against a table

    I'm not quite clear on what you are asking. Is the table on the far right the lookup table and the table in the middle the one you wish to populate? What happens if there are two keywords in the search term?

  6. #6
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: Find elements of text in a cell and poss vlookup against a table

    Maybe………..

    1] In "Keyword" C6, copied down :

    =LOOKUP(1,-SEARCH(K$6:K$17,B6),K$6:K$17)

    2] In "Category" D6, copied down :

    =LOOKUP(1,-SEARCH(K$6:K$17,B6),J$6:J$17)

    Regards
    Bosco

  7. #7
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Re: Find elements of text in a cell and poss vlookup against a table

    Hi AliGW.

    The table on the left is going to be the data I want to review (column B is the element I want to search against)

    The table on the right is the list of elements I want it to find against, and the category that each sits under (basically, I've got a list of 1,000's of keywords and I want to scan them for the different categories they may be under, such as brand terms, products, markets etc, and this should avoid doing it manually). This will be added to continually; if there's new categories, keyword elements etc, then I'll add them in at the bottom and resort

    The formula should scan the keywords in column B and find any instances of this in column K, and then return the Keyword element and Category (i.e. if it contains the brand term, it'll return 'brand', if it's product A, it'll return 'product A'.

    Putting the keyword part in Column C isn't necessary - it's the Category I want, but if the keyword can be shown then that's useful to have.

    Good point re: 2+ instances of this as not something I'd considered. Could it return multiple categories in different columns (e.g. Keyword contains elements from Category A, B, Brand and so on?) or would that cause issues?


    The 'keyword'

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Find elements of text in a cell and poss vlookup against a table

    C6=LOOKUP(2,1/SEARCH(K$6:INDEX(K:K,MATCH("ZZ",K:K)),$B6),K$6:INDEX(K:K,MATCH("ZZ",K:K)))
    D6=LOOKUP(2,1/SEARCH(K$6:INDEX(K:K,MATCH("ZZ",K:K)),$B6),J$6:INDEX(J:J,MATCH("ZZ",K:K)))
    Try this and copy towards down

  9. #9
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Re: Find elements of text in a cell and poss vlookup against a table

    Thanks Bosco & nflsales! Both of those formulas seem to do the core element of what I need, appreciate it!

    Do you have any thoughts on how I could flag up instances of 2+ category keywords showing up.

    e.g. if the search term is "ABC widget buy online that would come under Brand & Product A. In both of your formulas, it shows up as Product A, but would it be possible to show it as both Brand and Product A (maybe in an additional column? or is that just complicating things?

    Thanks

  10. #10
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Find elements of text in a cell and poss vlookup against a table

    C6=
    Please Login or Register  to view this content.
    Try this and copy paste across C6:F12

  11. #11
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Re: Find elements of text in a cell and poss vlookup against a table

    Thanks Nflsales!

    Thanks for this; will this show the 'brand' element and then any other category, or does it show anything else? I've tested it and can see it shows a Brand and Product A (if I duplicate the columns), but not sure if there's any other parts I should know?

+ 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] Use VLOOKUP to find string of text in a cell ??
    By rodneyoz in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-25-2018, 06:10 PM
  2. [SOLVED] Using vlookup to find text on different sheet. (Text will not always in the same cell)
    By onlyconnect in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-14-2014, 11:33 AM
  3. Replies: 0
    Last Post: 12-26-2013, 01:12 PM
  4. [SOLVED] Find a text in a cell (which is also in a table)
    By bebongtheshark in forum Excel General
    Replies: 5
    Last Post: 08-07-2013, 04:08 AM
  5. Using a vlookup return cell with mixed elements in a subsequent calculation
    By jonesyhouse in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-10-2012, 07:45 AM
  6. Find specific text within a cell using IF and VLOOKUP vba
    By dean.rogers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2012, 12:37 PM
  7. [SOLVED] Pivot Table for survey data w/ questions as Rows & poss answrs as
    By pfwebadmin in forum Excel General
    Replies: 0
    Last Post: 05-17-2005, 10:06 AM

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