Originally Posted by

**XOR LX**
Hi,

Managed to get it into one **array** formula (though it's hardly elegant!):

=SUM((SUBTOTAL(9,OFFSET(E2,SMALL(IF(ISNUMBER(MATCH(D2:D11,A2:A5,0)),ROW(D2:D11)-MIN(ROW(D2:D11)),""),ROW(INDIRECT("1:"&SUMPRODUCT(--(ISNUMBER(MATCH(D2:D11,A2:A5,0))))))),,,))*N(OFFSET(B2,SMALL(IF(ISNUMBER(MATCH(A2:A5,D2:D11,0)),ROW(A2:A5)-MIN(ROW(A2:A5)),""),ROW(INDIRECT("1:"&SUMPRODUCT(--(ISNUMBER(MATCH(A2:A5,D2:D11,0))))))),,,))))/SUM(SUBTOTAL(9,OFFSET(B2,SMALL(IF(ISNUMBER(MATCH(A2:A5,D2:D11,0)),ROW(A2:A5)-MIN(ROW(A2:A5)),""),ROW(INDIRECT("1:"&SUMPRODUCT(--(ISNUMBER(MATCH(A2:A5,D2:D11,0))))))),,,)))

Regards

## Bookmarks