Simplify Weighted Average Formula
On Fri, 4 Jun 2010 21:04:38 -0700, ferne
wrote:
I have a s/s that has the months of the year across the top and below 3
categories for each month and I want a weighted avg for each product. eg:
A B C D E F G H I
January February March etc. to Dec
Days Oil Gas Days OIl Gas Days Oil Gas
6 12 200 4 5 180 7 8 300
formula: =(a1*b1+D1*E1+G1*h1)/(a1+d1+g1)
Is there a way to simplify this? Thank in advance for any help.
If you don't want to rearrange your data, try this formulas:
For the "days-weighted" average of Oil:
=SUMPRODUCT((A2:AH2="Days")*A3:AH3*B3:AI3)/SUMIF(A2:AH2,"Days",A3:AH3)
For the "days-weighted" average of Gas:
=SUMPRODUCT((A2:AH2="Days")*A3:AH3*C3:AJ3)/SUMIF(A2:AH2,"Days",A3:AH3)
Hope this helps / Lars-Åke
|