Hi,
can you attach a small data sample that illustrates how your workbook is structured? It'll be much easier to suggest a solution. Right now, I'm leaning towards something like SUMPRODUCT or SUMIFS, or an array formula.

Click "Go Advanced" below and then the paper clip icon to attach a file.

cheers