I don't think it can be done with SUMPRODUCT, I think you're going to end up needing an array solution.

Can you post an example spreadsheet to work with?