=COUNTIF($A$2:$A$25,$G2)

=SUMIF($A$2:$A$25,$G2,C2:$C$25)

Itry this,
sorry for previous message, just now realized my error