Extract unique list from column a if column x has a value

Fazila

Board Regular
Joined
Nov 19, 2014
Messages
163
As the title says really. I have a table which looks something like:

EthnicityEnglishMathsScienceTriple ScienceArtDramaCitizenshipGeography
1Black CaribbeanYYYYY
2AfghanYYYYY
3AfghanYYYYY
4IndianYYYYYYY

<tbody>
</tbody>

So I want a unique list of Ethnicities for all students who are studying Art.

At the moment I am using formula {=IFERROR(INDEX(Ethnicity,MATCH(0,COUNTIF($B$30:B30,Ethnicity),0)),"")}, however, this just gives me a list of unique ethnicities for the entire cohort of students not just the ones studying the subject.

Any help would be appreciated.

Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Maybe something like...


ABCDEFGHI
1EthnicityEnglishMathsScienceTriple ScienceArtDramaCitizenshipGeography
2Black CaribbeanYYYYY
3AfghanYYYYY
4AfghanYYYYY
5IndianYYYYYYY
6
7
8Drama
9Black Caribbean
10Afghan

<tbody>
</tbody>

A9=IFERROR(INDEX($A$2:$A$5,SMALL(IF(FREQUENCY(IF($B$2:$I$5="Y",IF($B$1:$I$1=$A$8,MATCH($A$2:$A$5,$A$2:$A$5,0))),ROW($A$2:$A$5)-ROW($A$2)+1),ROW($A$2:$A$5)-ROW($A$2)+1),ROWS($A$9:A9))),"") Control Shift Enter
 
Upvote 0
Maybe something like...


ABCDEFGHI
1EthnicityEnglishMathsScienceTriple ScienceArtDramaCitizenshipGeography
2Black CaribbeanYYYYY
3AfghanYYYYY
4AfghanYYYYY
5IndianYYYYYYY
6
7
8Drama
9Black Caribbean
10Afghan

<tbody>
</tbody>

A9=IFERROR(INDEX($A$2:$A$5,SMALL(IF(FREQUENCY(IF($B$2:$I$5="Y",IF($B$1:$I$1=$A$8,MATCH($A$2:$A$5,$A$2:$A$5,0))),ROW($A$2:$A$5)-ROW($A$2)+1),ROW($A$2:$A$5)-ROW($A$2)+1),ROWS($A$9:A9))),"") Control Shift Enter

Thanks for posting Weazel. The data posted above is only a very small sample so I think the formula would get very convoluted if I was to delete rows with every ethnicity.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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