I’m trying to make one formula that calculates:
SUM[ Qi * (P1i - P2i), i=1 to n]
Example:
Q X P1 P2
100 2,261.00 22.61 22.59
19,600 200,151.39 10.21 10.18
10,700 800,008.00 74.77 74.84
[100 * (22.61 – 22.59 )] + [19,699 * (10.21 – 10.18)] + ….
I can do an workaround adding one column with my first calculation and then SUM the column. But i’m just curious if i could do this different.
You could try a
SUMPRODUCT(assuming your data starts inA2):And extend the
4to the boundary you want.