Lookup Nth Match Multiple Criteria

Lewzerrrr

Active Member
Joined
Jan 18, 2017
Messages
256
Hey,

I can't work this one out and I've looked everywhere but can't wrap my brain around it properly.

I'm trying to return a value with 2 criteria and moving past the duplicates, from a standard INDEX MATCH SMALL IF ROW the ROW at the end returns the array of the SMALL but it's not moving past the duplicate.

Sample data with formulas in B2:B6 =INDEX(Dump!$G$5:$G$13147,SMALL(IF(Dump!$D$5:$D$13147=A2,IF(Dump!$R$5:$R$13147=E2,ROW(Dump!$G$5:$G$13147)-ROW(Dump!$G$5)+1)),ROW($1:1))) confirmed with CSE.

The -6 is a duplicate and I can't get past it, any help? If I hardcore the ROW($1:1) to 1 and then change the formula in B6 to a 2 it finds the duplicate.

Thanks,

Master
Current
Department
Name
Master
Line Number
Master
Line Name
FC Sales TWFC Sales vs LW
NIGHTWEAR01H05MBLEESPRESSO YOURSELF0-7
NIGHTWEAR01T05MNUDSHORT SATIN JERSEY6-6
NIGHTWEAR01M25LPNKC+T ESME VINTAGE3-6
NIGHTWEAR01T03MBLETRSR JER OXF STRIPE0-6
NIGHTWEAR01T03MBLETRSR JER OXF STRIPE0-6

<colgroup><col><col><col><col span="2"></colgroup><tbody>
</tbody>
 
OK. I had to add a helper column which you could hide:

ABCDEFGH
1DataResult
2Criteria1Criteria2Line No.Criteria1Criteria2Line No.Helper
3A2Line1A5Line71
4A4Line2A5Line82
5A1Line3A4Line21
6A3Line4A1Line31
7A2Line5A1Line92
8A2Line6B5Line121
9A5Line7B5Line152
10A5Line8B4Line141
11A1Line9B3Line111
12A5Line10B1Line161
13B3Line11C5Line261
14B5Line12C4Line241
15B3Line13C3Line231
16B4Line14C2Line271
17B5Line15C2Line282
18B1Line16
19B2Line17
20B2Line18
21B2Line19
22B1Line20
23C1Line21
24C1Line22
25C3Line23
26C4Line24
27C3Line25
28C5Line26
29C2Line27
30C2Line28
31C4Line29
32C5Line30

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
H3=IF(AND($E3=$E2,$F3=$F2),H2+1,1)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
G3{=IFERROR(INDEX($C$3:$C$32,SMALL(IF($A$3:$A$32=$E3,IF($B$3:$B$32=$F3,ROW($C$3:$C$32)-ROW($C$3)+1)),$H3)),"")}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



WBD

I’m not at a computer so can’t test this but instead of helper can’t I replace the $H3 with a COUNTIFS($E$3:E3,E3,$F$3:F3,F3) it produced the same sequence on my mobile version of Excel?
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Indeed you can.


Book1
ABCDEFG
1DataResult
2Criteria1Criteria2Line No.Criteria1Criteria2Line No.
3A2Line1A5Line7
4A4Line2A5Line8
5A1Line3A4Line2
6A3Line4A1Line3
7A2Line5A1Line9
8A2Line6B5Line12
9A5Line7B5Line15
10A5Line8B4Line14
11A1Line9B3Line11
12A5Line10B1Line16
13B3Line11C5Line26
14B5Line12C4Line24
15B3Line13C3Line23
16B4Line14C2Line27
17B5Line15C2Line28
18B1Line16
19B2Line17
20B2Line18
21B2Line19
22B1Line20
23C1Line21
24C1Line22
25C3Line23
26C4Line24
27C3Line25
28C5Line26
29C2Line27
30C2Line28
31C4Line29
32C5Line30
Sheet1
Cell Formulas
RangeFormula
G3{=IFERROR(INDEX($C$3:$C$32,SMALL(IF($A$3:$A$32=$E3,IF($B$3:$B$32=$F3,ROW($C$3:$C$32)-ROW($C$3)+1)),COUNTIFS($E$3:$E3,$E3,$F$3:$F3,$F3))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.


WBD
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,079
Members
449,094
Latest member
mystic19

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