I wanted to find out a non zero weighted average from 2 arrays in google sheets - the weighted average/sumproduct should be calculated only when value in column A is not zero.
I cannot change or remove data - only a formula can solve this.
+----------+--------+
| Products | Orders |
+----------+--------+
| 5 | 1200 |
| 0 | 3497 |
| 14 | 1234 |
| 13 | 422 |
| 4 | 2444 |
| 21 | 13234 |
+----------+--------+
Desired Result = (5*1200 + 14*1234 + 13*422 + 4*2444 + 21*13234) / (1200 + 1234 + 422 + 2444 + 13234)
^^ Weights are Orders & orders where products = 0 (i.e. 2nd entry) will not be counted in the base