h2 cell =COUNTIF(A2:$A$25,$G2)

i2 cell =SUMIF(A2:$A$25,$G2,C2:$C$25)

the drop down