Finding the nth match of muliple criteria (but wildcards are needed)

Timmtamm

New Member
Joined
Aug 17, 2010
Messages
39
I can find the 1st match of my data, but I'm having trouble finding the 2nd, 3rd, etc.

Column A has a name, with a random number at the end (separated by a colon). Example: "Name1 : 283"
Column B has a name based off of a type of result. Example: "Type 10"
Column C has my results I'm looking for.

My formula for the 1st instance looks like this:
Where E1 is the 1st criteria "Name1"
and E2 is the 2nd criteria "Type 02"
Code:
{=INDEX(Sheet1!$C$1:$C$999,MATCH($E$1&"*"&"|"&$E$2&"*",Sheet1!$A1:$A999&"|"&Sheet1!$B1:$B999,0))}

How can I find the nth instance?

I tried this but it doesn't work with the wildcard.
Code:
=INDEX(Sheet1!O1:O999,SMALL(IF(Sheet1!$A1:$A999=($E$5&"*"),IF(Sheet1!C1:C999=$C$7,ROW(Sheet1!P1:P999))),3))

A simplified table looks like this (looking for the 3rd value of Name1):
Column AColumn BColumn CColumn DColumn E
1Name1 : 283Type 0221.25Name1
2Name1 : 283Type 1058.21Type 15
3Name1 : 187Type 1511.85
4Name1 : 187Type 2178.36Result Value
5Name2 : 155Type 1070.2211.85
6Name2 : 155Type 1192.18
7Name2 : 741Type 2144.32
8Name3 : 533Type 0218.64
9Name3 : 533Type 1027.36
10Name3 : 432Type 111.87
11Name3 : 432Type 1597.12
12Name3 : 432Type 2117.64
13Name4 : 381Type X#
14Name5 : 631Type X#
15Name5 : 374Type X#
16Name5 : 877Type X#
17Name6 : 678Type X#
18Name7 : 258Type X#
19Name7 : 258Type X#
20Name8 : 211Type X#

<tbody>
</tbody>
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I guess I failed to mention... Some of the "types" are sub lettered, so like "Type 10a" or "Type 10b." That's why I need a wildcard for that column as well.

Oh, and the failed version of the formula was posted incorrectly. It's actually:
Code:
=INDEX(C1:C999,SMALL(IF($A1:$A999=($E$5&"*"),IF(C1:C999=$C$7,ROW(A1:A999))),3))
 
Last edited:
Upvote 0
Ugg, keep catching my mistakes after I can't edit any longer. My appologies. The failed formula is actually:
Code:
{=INDEX(C1:C999,SMALL(IF($A1:$A999=($E$1&"*"),IF(C1:C999=($E$2&"*"),ROW(A1:A999))),3))}
 
Upvote 0
Based on your sample...
E​
F​
G​
1​
Name1
2​
Type 15
11.85​
3​
11.85​
1​
4​
Result Value
5​
11.85
F2=INDEX(C:C,SMALL(IF((LEFT($A$1:$A$20,LEN($E$1))=$E$1)*($B$1:$B$20=$E$2),ROW($A$1:$A$20)),ROWS($A$1:A1)))
enter use CSE

If you want the nth value - assuming you have more than 1 match (your sample did not)...
F3=INDEX(C:C,SMALL(IF((LEFT($A$1:$A$20,LEN($E$1))=$E$1)*($B$1:$B$20=$E$2),ROW($A$1:$A$20)),G3))
G3 would contain the nth value you wanted
 
Upvote 0
{=INDEX(Sheet1!$C$1:$C$999,MATCH($E$1&"*"&"|"&$E$2&"*",Sheet1!$A1:$A999&"|"&Sheet1!$B1:$B999,0))}

Like this:

Control+shift+enter, not just enter:

=INDEX(Sheet1!$C$1:$C$999,SMALL(IF(ISNUMBER(SEARCH($E$1&"*"&"|"&$E$2,Sheet1!$A1:$A999&"|"&Sheet1!$B1:$B999)),ROW(Sheet1!$C$1:$C$999)-ROW(Sheet1!$C$1)+1),3))

which looks for the 3rd occurrence.
 
Upvote 0
Hope someone can assist me with this, struggling so much that had to join and post the question!

How can this be amended to look horizontally instead of vertically?
 
Upvote 0

Forum statistics

Threads
1,214,667
Messages
6,120,820
Members
448,990
Latest member
rohitsomani

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top