+ Reply to Thread
Results 1 to 7 of 7

Formula for matching any part of a cell against a list in other worksheet

  1. #1
    Registered User
    Join Date
    04-23-2014
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Formula for matching any part of a cell against a list in other worksheet

    I have a cell that contains multiple product names separated by commas. The cell can have 1 to 15 product names. I then have a list of specific product names on another worksheet in the same workbook. How would the formula be written to do the following: if any of the product names in cell "A1" match anything in the list on the other worksheet return a "yes" otherwise return a "no"?

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Formula for matching any part of a cell against a list in other worksheet

    Well I dont really like this but you could try

    =IF(NOT(ISERROR(FIND(Sheet2!A1,A1)))+NOT(ISERROR(FIND(Sheet2!A2,A1)))+NOT(ISERROR(FIND(Sheet2!A3,A1)))+NOT(ISERROR(FIND(Sheet2!A4,A1)))+NOT(ISERROR(FIND(Sheet2!A5,A1)))+NOT(ISERROR(FIND(Sheet2!A6,A1)))+NOT(ISERROR(FIND(Sheet2!A7,A1)))+NOT(ISERROR(FIND(Sheet2!A8,A1)))+NOT(ISERROR(FIND(Sheet2!A9,A1)))+NOT(ISERROR(FIND(Sheet2!A10,A1)))+NOT(ISERROR(FIND(Sheet2!A11,A1)))+NOT(ISERROR(FIND(Sheet2!A12,A1)))+NOT(ISERROR(FIND(Sheet2!A13,A1)))+NOT(ISERROR(FIND(Sheet2!A14,A1)))+NOT(ISERROR(FIND(Sheet2!A15,A1)))=0,"n","y")

    where A1 is your cell and Sheet2!A1:A15 is the list

    VBA might be a more legible route
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Formula for matching any part of a cell against a list in other worksheet

    It moght be easier to break out the products into individual cells/columns using Text2Columns, then using a vlookup based on that?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: Formula for matching any part of a cell against a list in other worksheet

    Try something like this...

    Data Range
    A
    B
    C
    1
    ProdA, Prod10, ProdB
    Yes
    2
    ------
    ------
    ------
    3
    Prod5
    4
    Prod6
    5
    Prod7
    6
    Prod8
    7
    Prod9
    8
    Prod10


    This formula entered in C1:

    =IF(COUNT(LOOKUP(35000,SEARCH(A3:A8,A1))),"Yes","No")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    04-23-2014
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Formula for matching any part of a cell against a list in other worksheet

    Thank you Tony. That worked!

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Formula for matching any part of a cell against a list in other worksheet

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

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

    Re: Formula for matching any part of a cell against a list in other worksheet

    You're welcome. Thanks for the feedback!

+ 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. Replies: 2
    Last Post: 06-13-2013, 03:15 PM
  2. Matching Values - Formula Question - Part 2
    By Girish Punjabi in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-22-2013, 01:33 AM
  3. Replies: 2
    Last Post: 01-11-2011, 07:02 AM
  4. matching part of an entry in a cell
    By Andyd74 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2006, 01:10 PM
  5. [SOLVED] worksheet tab name as part of a cell reference
    By cwee in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-10-2005, 01:06 PM

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