Hi,
I have a data dump in 1 sheet with 20+ departments that I need to pull the top 20 bestsellers for each.
I can do an array formula using INDEX SMALL IF ROW-ROW ROWS however that only pulls if the data is sorted so do I need to incorporate LARGE into this somehow?
Example based on top 3.
[TABLE="width: 512"]
<colgroup><col span="8"></colgroup><tbody>[TR]
[TD][/TD]
[TD="colspan: 2"]Finished Result[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]Data Dump[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Dept1[/TD]
[TD]Line5[/TD]
[TD="align: right"]6121[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line1[/TD]
[TD="align: right"]5435[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Dept1[/TD]
[TD]Line4[/TD]
[TD="align: right"]5830[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line2[/TD]
[TD="align: right"]4675[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD]Dept1[/TD]
[TD]Line1[/TD]
[TD="align: right"]5435[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line3[/TD]
[TD="align: right"]4794[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD]Dept2[/TD]
[TD]Line8[/TD]
[TD="align: right"]9372[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line4[/TD]
[TD="align: right"]5830[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD]Dept2[/TD]
[TD]Line6[/TD]
[TD="align: right"]7102[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line5[/TD]
[TD="align: right"]6121[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD]Dept2[/TD]
[TD]Line10[/TD]
[TD="align: right"]5270[/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line6[/TD]
[TD="align: right"]7102[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD]Dept3[/TD]
[TD]Line14[/TD]
[TD="align: right"]7219[/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line7[/TD]
[TD="align: right"]2965[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD]Dept3[/TD]
[TD]Line12[/TD]
[TD="align: right"]5000[/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line8[/TD]
[TD="align: right"]9372[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD]Dept3[/TD]
[TD]Line13[/TD]
[TD="align: right"]3247[/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line9[/TD]
[TD="align: right"]4447[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line10[/TD]
[TD="align: right"]5270[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line11[/TD]
[TD="align: right"]1181[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line12[/TD]
[TD="align: right"]5000[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line13[/TD]
[TD="align: right"]3247[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line14[/TD]
[TD="align: right"]7219[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line15[/TD]
[TD="align: right"]1745[/TD]
[/TR]
</tbody>[/TABLE]
I have a data dump in 1 sheet with 20+ departments that I need to pull the top 20 bestsellers for each.
I can do an array formula using INDEX SMALL IF ROW-ROW ROWS however that only pulls if the data is sorted so do I need to incorporate LARGE into this somehow?
Example based on top 3.
[TABLE="width: 512"]
<colgroup><col span="8"></colgroup><tbody>[TR]
[TD][/TD]
[TD="colspan: 2"]Finished Result[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]Data Dump[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Dept1[/TD]
[TD]Line5[/TD]
[TD="align: right"]6121[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line1[/TD]
[TD="align: right"]5435[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Dept1[/TD]
[TD]Line4[/TD]
[TD="align: right"]5830[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line2[/TD]
[TD="align: right"]4675[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD]Dept1[/TD]
[TD]Line1[/TD]
[TD="align: right"]5435[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line3[/TD]
[TD="align: right"]4794[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD]Dept2[/TD]
[TD]Line8[/TD]
[TD="align: right"]9372[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line4[/TD]
[TD="align: right"]5830[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD]Dept2[/TD]
[TD]Line6[/TD]
[TD="align: right"]7102[/TD]
[TD][/TD]
[TD]Dept1[/TD]
[TD]Line5[/TD]
[TD="align: right"]6121[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD]Dept2[/TD]
[TD]Line10[/TD]
[TD="align: right"]5270[/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line6[/TD]
[TD="align: right"]7102[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD]Dept3[/TD]
[TD]Line14[/TD]
[TD="align: right"]7219[/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line7[/TD]
[TD="align: right"]2965[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD]Dept3[/TD]
[TD]Line12[/TD]
[TD="align: right"]5000[/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line8[/TD]
[TD="align: right"]9372[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD]Dept3[/TD]
[TD]Line13[/TD]
[TD="align: right"]3247[/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line9[/TD]
[TD="align: right"]4447[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept2[/TD]
[TD]Line10[/TD]
[TD="align: right"]5270[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line11[/TD]
[TD="align: right"]1181[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line12[/TD]
[TD="align: right"]5000[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line13[/TD]
[TD="align: right"]3247[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line14[/TD]
[TD="align: right"]7219[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dept3[/TD]
[TD]Line15[/TD]
[TD="align: right"]1745[/TD]
[/TR]
</tbody>[/TABLE]