@Dec2Hex(3563)
Interesting problem.
I could get the values for everything except MRP lookups. Here is the formula.
=SUMIFS($O$3:$O$11, $K$3:$K$11,A2, INDEX($L$3:$N$11,,MATCH(E2,$L$2:$N$2,0)), INDEX(B2:D2,MATCH(E2,$B$1:$D$1,0)))
How it works?
1. We are going to SUM up the margin codes...