You can do it with an array formula such as
{=INDEX($C$2:$C$11,MATCH($E3,IF($B$2:$B$11=F$2,$A$2:$A$11),0))}
This assumes you've layed your results table out thus:-
Blank Maths English Science ICT History
Fred
Sally
This assumes that $E3 = Name of student and F$2 = Subject
Remember to Ctrl Shift Enter it to get the curly bracket, don't try and type them
Working example available but you'll need to pm me. I'm in a band and off gigging tonight but can look tomorrow for you
Regards
Lee