If you are ok with using a helper column, Put this in E3, copied down...
=IF(COUNTIFS($B$3:B3,B3,$C$3:C3,C3)=1,D3,"")
Then use this for your totals...
=SUMIF($C$3:$C$26,B29,$E$3:$E$26)