What this currently does is if P:P match whats in R2 then it sums whats in M:M

What I need is iif... P:P matches whats in R2 and if K:K matches whats in W2 then sum what is in M:M