Help with array formula

alombia

Board Regular
Joined
Jan 14, 2016
Messages
89
ABCDEFGHI…
1NameYearEng 1Eng 2Eng 3Mat1Mat2Mat 3…
2John1342357979034
3Sam1347687341090
4Luke2679845903498
5Lucy3986745678690
6May375476239438

<tbody>
</tbody>

Hi,
I would like help with a formula to retrieve filtered results from the above Sheet called Sheet1 and pasted into Sheet2 in say Cell A1
There are two selection criteria: Year and Subject. I need the formula to display all the results matching the selected criteria. For example, Year 1 and Eng. So Cell A1 has the Year value. Cell A2 has the subject value (subjects are in cell D1:I1)
I’m guessing an array formula would be good so that it can be pasted over into different cells.
 
...Sorry ... since in cell B2 you do have your list of Unique individuals ...

you should test the formula in cell C2 ... :wink:
 
Upvote 0
This works fine for the most part, but where there are duplicate names in sheet 1 column A, it produces incorrect data. For example:

In the above, you can see that A3 and A6 have same names but different Years in B. But your formula retrieves A3, even when '3' is selected in A2 of sheet2. What is happening?

I see. Try the corrected formulas.


Excel 2010
ABCDE
1YearSubject
23Eng
3
4NameYearEng 1Eng 2Eng 3
5Lucy3986745
6May375476
Sheet2
Cell Formulas
RangeFormula
C5=IFERROR(1/(1/SUMPRODUCT(($A5=Sheet1!$A$2:$A$6)*($B5=Sheet1!$B$2:$B$6)*(C$4=Sheet1!$C$1:$H$1)*(Sheet1!$C$2:$H$6))),"")
C4{=IFERROR(INDEX(Sheet1!$C1:$H1,SMALL(IF(LEFT(Sheet1!$C1:$H1,3)=$B$2,COLUMN(Sheet1!$C1:$H1)),COLUMN(A$1:A$6))-2),"")}
A5{=IFERROR(INDEX(Sheet1!$A$2:$A$6,SMALL(IF(Sheet1!$B$2:$B$6=$A$2,ROW(Sheet1!$B$2:$B$6)-1),ROW(Sheet1!1:1))),"")}
B5{=IFERROR(INDEX(Sheet1!$B$2:$B$6,MATCH(A5&$A$2,Sheet1!$A$2:$A$6&Sheet1!$B$2:$B$6,0)),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

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