Hello
I am trying to calculate a weighted average but some of the values in the range and some of the weightings will often be zero.
This is what I have come up with so far:
=SUMPRODUCT(O231:O240,R231:R240)/COUNTIF(R231:R240,">0")
R contains the weightings and O contains the values but it's not working. The XL2BB is below,
Can anyone see the issue?
Thank you
I am trying to calculate a weighted average but some of the values in the range and some of the weightings will often be zero.
This is what I have come up with so far:
=SUMPRODUCT(O231:O240,R231:R240)/COUNTIF(R231:R240,">0")
R contains the weightings and O contains the values but it's not working. The XL2BB is below,
Can anyone see the issue?
Thank you
Book1 | ||||||
---|---|---|---|---|---|---|
O | P | Q | R | |||
231 | 0.00 | 0.00 | ||||
232 | 0.00 | 0.00 | ||||
233 | 0.00 | 0.00 | ||||
234 | 23.59 | 135.60 | 15.75 | 0.38 | ||
235 | 35.46 | 131.27 | 16.81 | 0.06 | ||
236 | 0.00 | 0.00 | ||||
237 | 19.24 | 111.12 | 15.04 | 0.10 | ||
238 | 2.43 | 56.35 | 0.04 | |||
239 | 0.00 | 0.00 | ||||
240 | 29.13 | 152.02 | 20.37 | 0.42 | ||
Summary |
Cell Formulas | ||
---|---|---|
Range | Formula | |
O231:O240 | O231 | =IF(I231="",0,(I231*L231)) |
P231:Q240 | P231 | =IF(J231="","",(J231*M231)) |
R231:R240 | R231 | =(C231/$C$230) |