How to calculate a weighted average in Excel
SheetFluent team · · 6 min read
A weighted average multiplies each value by its weight, adds those results up, and divides by the total of the weights. In Excel the one-cell formula is =SUMPRODUCT(, with values in B and weights in C. If you'd rather see each step, add a column that multiplies value by weight, then use =SUM(. Both give the same answer in Excel and Google Sheets.
=SUMPRODUCT(B2:B5,C2:C5)/SUM(C2:C5)
Weighted average or plain average?
A plain average treats every value as equally important. AVERAGE adds the values and divides by how many there are.
A weighted average lets some values count more than others. A course grade is the classic case. Homework might count for 20% of the grade and the final exam for 35%, so a strong final exam lifts the grade more than strong homework does.
Take this course: Homework 88 (weight 20), Quizzes 75 (weight 20), Midterm 82 (weight 25) and Final exam 90 (weight 35). The plain average of the four scores is 83.75. The weighted average is 84.6, because the 90 on the final carries the most weight.
Use a weighted average whenever the items are not equal in size or importance: grades with different weights, the average price paid across orders of different sizes, or the average rating across products with different numbers of reviews.
See also: Find the average with AVERAGE
Step by step with a helper column
This method shows every step, so it is easy to check. Put the scores in B2:B5 and the weights in C2:C5.
1. In D1, type a heading such as Weighted.
2. In D2, type =B2 to multiply the first score by its weight. Press Enter.
3. Fill D2 down to D5. Each row now shows its score times its weight: 1760, 1500, 2050 and 3150.
4. In the cell for the answer, type =SUM(. This adds up the weighted scores (8460) and divides by the total weight (100). The result is 84.6.
Always divide by the sum of the weights, not by the number of items. Dividing by 4 here would give 2115, which is meaningless. Dividing by SUM( also keeps the formula right if someone changes a weight later.
=B2*C2
=SUM(D2:D5)/SUM(C2:C5)See also: Add, subtract, multiply, divide, Add up a column with SUM
One formula with SUMPRODUCT
SUMPRODUCT does the multiply-and-add in one go. SUMPRODUCT( multiplies B2 by C2, B3 by C3 and so on, then adds the results. Divide that by the total weight and you have the weighted average without a helper column.
The two ranges must be the same size and line up row by row. If one is B2:B5 and the other is C2:C6, Excel returns a #VALUE! error.
The exercise below uses this one-cell formula. The helper column gives exactly the same answer, and it is easier to check when a number looks wrong, so it is worth knowing both.
=SUMPRODUCT(B2:B5,C2:C5)/SUM(C2:C5)See also: Price times quantity with SUMPRODUCT
Weights as percentages, decimals or counts
Weights can be written as percentages (20%, 35%), decimals (0.2, 0.35) or plain numbers (20, 35). The formula is the same for all three, because it divides by the sum of the weights.
When the weights add up to exactly 100% or 1, dividing by their sum doesn't change the answer, so some people leave the division out. Keep it in. If the weights add up to 95% because one was typed wrongly, the division still gives a fair average, and a SUM of the weights next to the table shows you the typo.
Counts work as weights too. To find the average price paid per unit across three orders, use the unit price as the value and the number of units as the weight. Orders of 100 units at $4.00, 300 units at $3.50 and 50 units at $5.00 give a weighted average of $3.78 per unit, not the plain average of $4.17.
Common mistakes
Using AVERAGE on the scores. AVERAGE ignores the weights, so it gives the plain average. Use it only when every weight is equal.
Using AVERAGE on the helper column. This divides the weighted total by the number of rows instead of by the total weight. The answer is far too big.
Typing the total weight as a number. =SUM( works today but breaks when a weight changes. Use SUM( so the total updates itself.
Ranges that stop one row short. If the scores run to row 5, both ranges need to end at row 5. A range that stops at row 4 leaves the final exam out completely.
Blank weights. A blank weight counts as 0, so that item is left out of the average. That is usually what you want for an assignment not yet marked, but check it is intended.
See also: Excel formula not working? How to find the cause and fix it, Excel formulas cheat sheet
Check the answer makes sense
A weighted average always lands between the smallest and largest value. Here the scores run from 75 to 90, so an answer of 84.6 is believable. An answer of 2115 or 8.46 tells you the division is wrong.
It also leans toward the values with the biggest weights. The final exam carries the most weight and has the highest score, so the weighted average (84.6) sits a little above the plain average (83.75). If a heavily weighted score were low, the weighted average would fall below the plain one.
To see the effect of one item, change its weight and watch the answer move. If the answer doesn't change, the formula isn't using that weight, which usually means a range stops one row short.
Weighted average in Google Sheets
Every formula on this page works in Google Sheets. Sheets also has AVERAGE.WEIGHTED, which takes the values and then the weights: =AVERAGE.WEIGHTED(. Excel doesn't have that function, so if the file will be opened in Excel, stick with SUMPRODUCT or the helper column.
=AVERAGE.WEIGHTED(B2:B5,C2:C5)Try it here
Type the formula into the answer cell, then press Enter or Check.
In B6, find the weighted average grade. SUMPRODUCT already multiplies each score by its weight and adds them up. Divide that by the total weight.
| A | B | C | |
|---|---|---|---|
| 1 | Part | Score | Weight |
| 2 | Homework | 88 | 20 |
| 3 | Quizzes | 75 | 20 |
| 4 | Midterm | 82 | 25 |
| 5 | Final | 90 | 35 |
| 6 | Avg | =SUMPRODUCT(B2:B5,C2:C5)/ (answer cell) |
In B6, find the weighted average grade. SUMPRODUCT already multiplies each score by its weight and adds them up. Divide that by the total weight.
Start practicingQuestions people ask
What is the formula for a weighted average in Excel?
=SUMPRODUCT(, with values in B and weights in C. Or multiply each row in a helper column and divide its SUM by the SUM of the weights.
Do the weights have to add up to 100%?
No. Dividing by the sum of the weights makes the formula work whatever they add up to.
When is a weighted average the same as AVERAGE?
Only when every weight is equal. Then each value counts the same, and both formulas give the same answer.
Is there a weighted average function in Google Sheets?
Yes, =AVERAGE.WEIGHTED(. Excel doesn't have it, so use SUMPRODUCT in files that will be opened in Excel.
Keep practicing
Practice this in the full lesson: Price times quantity with SUMPRODUCT
Related articles
- Excel formulas cheat sheet7 min read
The Excel formulas you'll use most, grouped by job: totals, counting, conditions, lookups, text and rounding, each with an example. Print or save as PDF.
Find the highest value and return the name next to it with =XLOOKUP(MAX(B2:B6),B2:B6,A2:A6), or INDEX and MATCH. Works in Excel and Google Sheets.
- How to calculate GST in Excel6 min read
Add GST with =B2*1.18, take it out of an inclusive price with =B2/1.18, and split it into CGST and SGST in Excel.