Sum using Specific Criteria

=SUMIF(range, criteria, (sum_range))

=SUMIF($D$2:$D$41,G2,$E$2:$E$41)
Please see the images below to understand.