Multiple computation in array of data
I have a table of scores, I want to get the total scores per Contestant and per Criteria. Any body knows the server code of these scores? Please help. Please see the target output below. Thank you.
TABLE
Score Contestant Criteria Judges
30 Contestant #1 Confident Judge #1
15 Contestant #1 Costume Judge #1
40 Contestant #1 Talent Judge #1
28 Contestant #1 Confident Judge #2
12 Contestant #1 Costume Judge #2
40 Contestant #1 Talent Judge #2
34 Contestant #2 Confident Judge #1
20 Contestant #2 Costume Judge #1
44 Contestant #2 Talent Judge #1
33 Contestant #2 Confident Judge #2
19 Contestant #2 Costume Judge #2
44 Contestant #2 Talent Judge #2
35 Contestant #3 Confident Judge #1
18 Contestant #3 Costume Judge #1
42 Contestant #3 Talent Judge #1
32 Contestant #3 Confident Judge #2
20 Contestant #3 Costume Judge #2
45 Contestant #3 Talent Judge #2
Confident = (sum of same criterias [2] ) / number of judges [2]
Costume = (sum of same criterias [2]) / number of judges [2]
Talent = (sum of same criterias [2]) / number of judges [2]
Total = Confident + Costume + Talent
FINAL OUTPUT
Contestant Name Confident Costume Talent Total
Contestant #1 29 13.5 40 82.5
Contestant #2
Contestant #3