Try

D2
Formula: copy to clipboard
=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,B2)=1,SUMIFS($C$2:$C$24,$A$2:$A$24,A2,$B$2:$B$24,B2),"")


Drag down