Solved

How to calculate the weighted average in Excel

Posted on 2014-11-11
9
194 Views
Last Modified: 2014-11-14
In an Excel spreadsheet, I need to calculate the weighted average of a column B regarding weights specified in A
This mean A1*B1 + A2*B2 + ... An*Bn / SUM(A1:An)
Is there a formula to do that easily ?
0
Comment
Question by:LeTay
  • 5
  • 3
9 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40434682
For A1:B3, you can use the following:

=SUMPRODUCT(A1:A3,B1:B3)/SUM(A1:A3)
0
 
LVL 2

Expert Comment

by:Pratik Makwana
ID: 40434690
Please find attached excel has your result and some useful average formulas...
Average.xlsx
0
 

Author Comment

by:LeTay
ID: 40434707
Many thanks but I forgot to tell you this : some cells are empty
And so if for example B3 is empty (but A3 not), A3*B3 and A3 should not participated in the calculation
So ?
0
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40434719
So...

=SUMPRODUCT(A1:A3,B1:B3)/SUMIF(B1:B3,"<>0",A1:A3)

It's OK for A3*B3 to participate, because if B3 is empty, then A3*B3 = 0.

It's only the SUM that needs to change.

So.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:LeTay
ID: 40436077
Formula is refused by Excel
Maybe a problem of , or ;
I don't know
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40436156
Can you please post your spreadsheet here.

Also, is your computer set up to be in standard English, or a different language?
0
 

Author Comment

by:LeTay
ID: 40443035
It is standard french
Will prepare a spreadsheet with data
0
 

Author Comment

by:LeTay
ID: 40443060
Problem was indeed french, and ;
But the test you propose ("<> 0") is not the good one.
Irrelevant cells are empty, not zero
So ?
0
 

Author Comment

by:LeTay
ID: 40443063
Found it :

=SUMPRODUCT(A1:A3,B1:B3)/SUMIF(B1:B3,"<>",A1:A3)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: This is the third blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   We’ve been talki…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Viewers will learn the basics about Excel 2013’s new Flash Fill feature.
Viewers will learn how to share Excel data with others from desktop Excel, as well as Excel Online via OneDrive, and embed an Excel file on a website.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now