+ Reply to Thread
Results 1 to 9 of 9

Find the nth match, using multiple criteria and wildcards

  1. #1
    Registered User
    Join Date
    02-11-2009
    Location
    Salt Lake City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    98

    Find the nth match, using multiple criteria and wildcards

    Hey, I'm trying to get this formula to find each correct value, without finding an incorrect value.

    My formula in G2:

    Please Login or Register  to view this content.
    ctrl+shift+enter

    Where the final "+0" changes to +1, +2, etc... to get the further results.

    Using the formula above, cell G4 gives the incorrect value of 55. I want it to be an error, because the 3rd value is not a "type".

    A B C D E F G
    1 Standard1 amt1 Type1 111 Type
    2 Standard1 amt1 Type2 41 amt2 231
    3 Standard1 amt1 Not 1 29 amt2 88
    4 Standard2 amt2 Type1 231 amt2 55
    5 Standard2 amt2 Type2 88
    6 Standard2 amt2 Not 1 55
    7 Name1 amt2 Type1 197
    8 Name1 amt2 Not 1 52
    9 Name2 amt2 Type1 245
    Attached Files Attached Files
    Excel: Not my profession, but useful in it.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,360

    Re: Find the nth match, using multiple criteria and wildcards

    Put in G2 and press as array formula then copied down

    =INDEX($D$1:$D$9,SMALL(IF($C$1:$C$9=$F2,ROW($D$1:$D$9)-ROW($D$1)+1),COUNTIF($E$2:F2,F2)))

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

    Re: Find the nth match, using multiple criteria and wildcards

    Here:

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


    confirmed with ctrl+shift+enter (not just enter).
    Write formula in G2 and drag it down as much as you need.

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Find the nth match, using multiple criteria and wildcards

    Or try

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


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,412

    Re: Find the nth match, using multiple criteria and wildcards

    Try this array formula in G2:

    Please Login or Register  to view this content.
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Quang PT

  6. #6
    Registered User
    Join Date
    02-11-2009
    Location
    Salt Lake City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Find the nth match, using multiple criteria and wildcards

    Thanks all. All seem to work.

    Shukla's solution seems to work best for my situation. It handles the variables better.

    Thanks again.

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

    Re: Find the nth match, using multiple criteria and wildcards

    Quote Originally Posted by timmtamm View Post
    Thanks all. All seem to work.

    Shukla's solution seems to work best for my situation. It handles the variables better.

    Thanks again.
    Just to note what is difference between FIND and SEARCH so you can adopt what is better to your solution:

    FIND is case sensitive. SEARCH is not.

    So if you want in Standard to use case sensitive to determine St then use FIND.
    If you don't want that use SEARCH but note that it will return TRUE in case you have "st".

    For example in the word: Test1st searching for St

    FIND will return error.
    SEARCH will return number.

    That could be a difference between various scenarios.
    I believe azumi's will return you also 55 and all other should work.

  8. #8
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Find the nth match, using multiple criteria and wildcards

    Thanks for feedback and Rep and Happy to help you...

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  9. #9
    Registered User
    Join Date
    02-11-2009
    Location
    Salt Lake City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Find the nth match, using multiple criteria and wildcards

    Quote Originally Posted by zbor View Post
    Just to note what is difference between FIND and SEARCH so you can adopt what is better to your solution:

    FIND is case sensitive. SEARCH is not.

    So if you want in Standard to use case sensitive to determine St then use FIND.
    If you don't want that use SEARCH but note that it will return TRUE in case you have "st".

    For example in the word: Test1st searching for St

    FIND will return error.
    SEARCH will return number.

    That could be a difference between various scenarios.
    I believe azumi's will return you also 55 and all other should work.
    Yea, Azumi's mearly repeated the results I already had. So not really a solution. The rest did work though, to differing degrees.

    Shukla's answer worked best because in my real sheet, what I labeled as "Type1" is actually a chemical name that sometime varies depending on my coworkers. For example (simplified): One person names the chemical "Terpene" and the next names it "Terpanoid." So really my search is based off of Terp+anything.

+ 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 multiple results with INDEX & MATCH on 2 criteria
    By SubwAy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-22-2017, 08:56 AM
  2. [SOLVED] Index Match with multiple criteria involving find text
    By 3345james in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-30-2015, 11:56 AM
  3. [SOLVED] Find/match multiple criteria and return value
    By Aaron092 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-01-2014, 07:22 AM
  4. Match Multiple Criteria & Find Oldest Date
    By DoodlesMama in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 12-04-2013, 11:10 AM
  5. Find records that match criteria of multiple fields
    By jvbeats in forum Access Tables & Databases
    Replies: 3
    Last Post: 03-12-2013, 05:40 PM
  6. Filter multiple criteria using wildcards
    By Opy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2012, 11:40 PM
  7. Replies: 3
    Last Post: 07-11-2009, 02:58 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