Hi,

In C6 and copy across and down:

=SUMIFS('RAW DATA'!$C:$C,'RAW DATA'!$A:$A,TOTALS!C$5,'RAW DATA'!$B:$B,TOTALS!$A6)

Regards