+ Reply to Thread
Results 1 to 4 of 4

alternative function to match (need "if containing" function, not an exact match)

  1. #1
    Registered User
    Join Date
    02-06-2010
    Location
    Washington, DC
    MS-Off Ver
    Excel 2007
    Posts
    5

    alternative function to match (need "if containing" function, not an exact match)

    By the help of this wonderful forum I have the following code, which searches a column across all worksheets in a workbook for certain terms, and if matches are found denote such in another column on the same row.

    Please Login or Register  to view this content.
    what i would want is an alternative to the "match" function, one that would find all the cells 'containing' a search phrase (not only if the cell 'exactly matches' the search phrase)

    i know you guys can do it.

  2. #2
    Forum Contributor
    Join Date
    04-18-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2016
    Posts
    269

    Re: alternative function to match (need "if containing" function, not an exact match)

    Use this code instead:

    Please Login or Register  to view this content.

    The Instr function in VB is the same as the Find function in Excel. It will return the match number. So, if any of the items in the list are present anywhere in the cell, it would return the value "Check" in the second column of the same row.

    Let me know if it works for you.

    Regards,
    Karan

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: alternative function to match (need "if containing" function, not an exact match)

    Quote Originally Posted by xln00b View Post
    what i would want is an alternative to the "match" function, one that would find all the cells 'containing' a search phrase (not only if the cell 'exactly matches' the search phrase)
    Erm, why not simply use wildcards in the MATCH ? eg:

    Please Login or Register  to view this content.

    The former being an exact match construct and the latter being a partial match construct.

  4. #4
    Forum Contributor
    Join Date
    04-18-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2016
    Posts
    269

    Re: alternative function to match (need "if containing" function, not an exact match)

    Nice solution DonkeyOte. I tried using '%' but it did not work. So, I worked out this alternate solution.

    --Karan--

+ 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