Combing INDEX, MATCH, SMALL, with multiple criteria

amagana

New Member
Joined
Jan 19, 2018
Messages
7
Good Afternoon,

I am needing a little help with a formula. What my goal is to have values reported back in a table below. The formula I have listed below works but currently, there is only one Criteria. The first criteria is Look up 8528529 in Column H and then report back the students SEIS ID #. But what I am now trying to accomplish is that only students in School type 70, 71, or 72 be reported back not school type 56. Any help that can be provided would be greatly appreciated.


{=IF(ISERROR(INDEX($H$1:$L$26,SMALL(IF($H$1:$H$26=$O$1,ROW($H$1:$H$26)),ROW(2:2)),5)),"",INDEX($H$1:$L$26,SMALL(IF($H$1:$H$26=$O$1,ROW($H$1:$H$26)),ROW(2:2)),5))}


Columns
H I J K L N O

CDS Code School TypeLast NameFirst NameSEIS IDLook up8528529
852852956RamirezAnna8579645Lookup>=70
125879656HallMaurice582694
148579670HewettCeDoshi1115628MatchesSEIS IDFirst NameLast NameSchool Type
852852970HallMaya459687
852697470SmithAaron Jaden156328
852852970YetmanHannah2509684
158748970ColemanGloria5566985
852852971MercadoHaylee1598632
556982371KendallMarleny2587032
458267972Troybella3206584
852852972HallShyanne2596842
115896472RamirezAriane2514895

<colgroup><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Unknown
HIJKLMNOPQR
1CDS CodeSchool TypeLast NameFirst NameSEIS IDLook up8528529
2852852956RamirezAnna8579645Lookup70
3125879656HallMaurice582694
4148579670HewettCeDoshi1115628MatchesSEIS IDFirst NameLast NameSchool Type
5852852970HallMaya459687459687MayaHall70
6852697470SmithAaron Jaden1563282509684HannahYetman70
7852852970YetmanHannah25096841598632HayleeMercado71
8158748970ColemanGloria55669852596842ShyanneHall72
9852852971MercadoHaylee1598632
10556982371KendallMarleny2587032
11458267972Troybella3206584
12852852972HallShyanne2596842
13115896472RamirezAriane2514895
14
15
Sheet19
Cell Formulas
RangeFormula
O5{=IFERROR(INDEX(INDEX($I$2:$L$13,0,MATCH(O$4,$I$1:$L$1,0)),SMALL(IF(($O$1=$H$2:$H$13)*($I$2:$I$13>=$O$2),ROW($H$2:$H$13)-ROW($H$2)+1),ROWS(O$5:O5))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
Here is a more efficient set up...

Row\Col
A​
B​
C​
D​
E​
G​
H​
I​
J​
K​
L​
M​
1​
CDS CodeSchool TypeLast NameFirst NameSEIS IDCDS code
8528529
4​
2​
8528529
56
RamirezAnna
8579645
Matches (Idx)SEIS IDFirst NameLast NameSchool Type
3​
1258796
56
HallMaurice
582694
Type to Include
Type to Exclude
4​
459687​
MayaHall
70​
4​
1485796
70
HewettCeDoshi
1115628
70​
56​
6​
2509684​
HannahYetman
70​
5​
8528529
70
HallMaya
459687
71​
8​
1598632​
HayleeMercado
71​
6​
8526974
70
SmithAaron Jaden
156328
72​
11​
2596842​
ShyanneHall
72​
7​
8528529
70
YetmanHannah
2509684
8​
1587489
70
ColemanGloria
5566985
9​
8528529
71
MercadoHaylee
1598632
10​
5569823
71
KendallMarleny
2587032
11​
4582679
72
Troybella
3206584
12​
8528529
72
HallShyanne
2596842
13​
1158964
72
RamirezAriane
2514895

In I1 control+shift+enter, not just enter:

=SUM(IF($A$2:$A$13=$H$1,IF(ISNA(MATCH($B$2:$B$13,$H$4:$H$4,0)),IF(ISNUMBER(MATCH($B$2:$B$13,$G$4:$G$6,0)),1))))

In I3 control+shift+enter, not just enter, and copy down:

=IF(ROWS($I$3:I3)>$I$1,"",SMALL(IF($A$2:$A$13=$H$1,IF(ISNA(MATCH($B$2:$B$13,$H$4:$H$4,0)),IF(ISNUMBER(MATCH($B$2:$B$13,$G$4:$G$6,0)),ROW($E$2:$E$13)-ROW($E$2)+1))),ROWS($I$3:I3)))

In J3 just enter, copy across, and down:

=IF($I3="","",INDEX($A$2:$E$13,$I3,MATCH(J$2,$A$1:$E$1,0)))
 
Upvote 0
Thank you for your help. This worked. Is it possible to distinguish that I only want 70-72 to be reported for the school type? Right now we have >=$O$2. 70 is listed in O2. I have tried using AND to include the other cells but that did not work. I also tried >=$O$2 and then <= and listed the cell with 72 as the school type. That did not work.
 
Upvote 0
Thank you for your help. This worked. Is it possible to distinguish that I only want 70-72 to be reported for the school type? Right now we have >=$O$2. 70 is listed in O2. I have tried using AND to include the other cells but that did not work. I also tried >=$O$2 and then <= and listed the cell with 72 as the school type. That did not work.

See post #3 , a more efficient set up.
 
Upvote 0
Thank you. That worked great!

On another section, I am wanting just to match the CDs code, and report back. There are no other criteria needed, how do I fix the formula?
 
Upvote 0
Sure. I would like the formula to report back all of the SEIS IDs from Column E that have the same CDS code (Column A) with H1. The previous formula did that but it added additional criteria of having to be in a certain school type. On this other table that I am working on I no longer need the additional criteria.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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