Hi

Use this for A)
Formula: copy to clipboard
=AGGREGATE(14,6,$A$2:$A$24/($C$2:$C$24="Secondaries")/($B$2:$B$24=2017),1)