weighted avg. of groups in table

G

Guest

i have a table with group #s in column A and values in column B.
i am using the formula below to calculate the average value (ignoring nulls)
of the relevant group on each row.
if i add a weighting in C1:C10 how do i calculate the weighted average of
each group?

=SUM(SUMIF(A1:A10,A1,B1:B10))/SUMPRODUCT((A1:A10=A1)*(B1:B10<>""))

thanks in advance for your time.
DK
 
G

Guest

=SUMPRODUCT(--(A1:A10=A1),--(B1:B10<>""),C1:C10,B1:B10)/SUMPRODUCT(--(A1:A10=A1),--(B1:B10<>""),C1:C10)
 
G

Guest

this worked perfectly.
thanks for this and for the earlier formula.
you are an excel rock-star!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top