Hi

Or another version:
=SUMIF(C5:C15,J20,D5:D15)+SUMIF(C5:C15,J21,D5:D15)

Kevin