Hi,
So here is an example spreadsheet similar to one that I'm working on:

My issue is regarding the output in rows 13-18 and what I'm struggling to do in particular is figure out what formula I need to put into the highlighted cell B14 to produce the expected result shown (once I know this I should easily be able to manipulate it for the rest).
From my research so far, I'm wondering if it may be a combination of the COUNTIF and SUMPRODUCT formulas but I'm fresh out of ideas and now starting to doubt if it's even possible.
Any advice at all would be very helpful and gratefully received.
So here is an example spreadsheet similar to one that I'm working on:

My issue is regarding the output in rows 13-18 and what I'm struggling to do in particular is figure out what formula I need to put into the highlighted cell B14 to produce the expected result shown (once I know this I should easily be able to manipulate it for the rest).
From my research so far, I'm wondering if it may be a combination of the COUNTIF and SUMPRODUCT formulas but I'm fresh out of ideas and now starting to doubt if it's even possible.
Any advice at all would be very helpful and gratefully received.