Hi Matt,

Put this formula in D24 and copy across to E24

=SUMPRODUCT(SUBTOTAL(2,OFFSET(D2,ROW(D2:D22)-ROW(D2),,1)),$B$2:$B$22,D2:D22)