row\col | a | b | c | d | e | f | g | h | i |
1 | type1 | type2 | total1 | total2 | percentage | | | bt | dt |
2 | e | bt | 50000 | 50000 | 5000 | | e | 5% | 3% |
3 | e | dt | 50000 | 50000 | 3000 | | o | | 3% |
4 | f | dt | 150000 | 50000 | 6000 | | f | | 3% |
5 | o | dt | 250000 | 50000 | 9000 | | | | |
<tbody>
</tbody>
in e2 enter and copy down:
Either [1]...
=sum(c2:d2)*index($h$2:$i$4,match(a2,$g$2:$g$4,0),match(b2,$h$1:$i$1,0))
or [2]...
=sum(c2:d2)*vlookup(a2,$g$1:$i$4,match(b2,$g$1:$i$1,0),0)
or [3], apply f9 to the ranges of the index bit in [1], and apply the result in e2 downwards...
=sum(c2:d2)*index({0.05,0.03;0,0.03;0,0.03},match(a2,{"e";"o";"f"},0),match(b2,{"bt","dt"},0))
or [4], apply f9 to the ranges of the vlookup bit in [2], and apply the result in e2 downwards...
=sum(c2:d2)*vlookup(a2,{0,"bt","dt";"e",0.05,0.03;"o",0,0.03;"f",0,0.03},match(b2,${0,"bt","dt"},0),0)
i posted [3] for you as one that you could invoke (and confuse your friends).
It's thus your lookup table that you see in-lined in the formula...