How to Calculate a Weighted Average
A simple average treats every value as equally important. A weighted average lets some values count for more, which is what you need whenever the items being averaged differ in size, quantity or significance.
The formula
Weighted average = sum of (value × weight) / sum of weights. If a course grade is 80% from coursework at 90% and 20% from an exam at 60%, the result is (0.8 x 90 + 0.2 x 60) = 84%.
The weights can be percentages that add to 100, or raw quantities such as shares of stock. The formula is the same; only the scale changes.
See the mean and median of your list, then weight by hand.
Open the Average Calculator →Grades
A module weighted 60% coursework and 40% exam, with marks of 72 and 55, gives 0.6 x 72 + 0.4 x 55 = 65.2. The simple average would be 63.5, which is close here and can be far apart when one component is much lower.
Always check the weighting before estimating a final grade. A weak exam counts for more than students often assume, and a strong coursework mark cannot rescue a heavily weighted exam.
Prices and quantities
Buying 10 units at $5 and 30 units at $7 gives a weighted average cost of (10 x 5 + 30 x 7) / 40 = $6.50. The simple average of $5 and $7 is $6, which is not what you paid.
This is the calculation behind average cost of inventory and average price paid for shares. It is the figure that matters for the total spend, and it is always pulled toward the larger quantity.
Portfolio returns
A portfolio split 70% in one fund returning 8% and 30% in another returning 2% has a weighted return of 0.7 x 8 + 0.3 x 2 = 6.2%.
The weights drift as the funds perform differently, which is why a portfolio needs rebalancing if you want to keep the intended allocation. A weighting set in January is not the weighting in December.
A worked table
| Item | Value | Weight | Contribution |
|---|---|---|---|
| Coursework | 90 | 0.6 | 54.0 |
| Exam | 60 | 0.4 | 24.0 |
| Total | 1.0 | 78.0 |
The contribution column is the value times the weight. Adding it gives the weighted average directly, which is easier to check than doing the whole calculation in one line.
When the simple mean is wrong
Any time the groups differ in size. Averaging the average order value of two shops with 100 and 10,000 customers gives equal weight to a tiny shop.
The same error appears in survey analysis, where an unweighted average over-represents groups that were sampled more heavily. Weighting corrects for that, which is why polling uses it.
Weights that do not add to 100
If the weights are raw counts, divide by their sum. If they are percentages that do not quite add to 100 because of rounding, normalise them by dividing each by the total before multiplying.
Do not assume the weights are correct just because they look plausible. A weighting that sums to 90 produces a result 10% too high, and the error is easy to miss.
Common mistakes
- Dividing by the number of values instead of the total weight.
- Averaging percentages with different bases.
- Using stale weights after quantities have changed.
- Mixing percentage weights and raw counts in one calculation.
- Rounding the weights so the total is not exactly 100.
Doing it in a spreadsheet
Put values in one column and weights in the next. The weighted average is SUMPRODUCT(values, weights) / SUM(weights). That single formula handles both percentage and count weights.
Check the result against a rough estimate. If the weighted average falls outside the range of the values, something in the formula is wrong.
A practical note
The hard part of a weighted average is not the arithmetic but deciding the weights and being able to justify them. Write down why each weight is what it is; otherwise the number looks objective while resting on a judgement.
That record also lets someone else check the calculation later, which matters in anything that affects a grade, a price or a published statistic.
Frequently asked questions
What is the difference between a weighted and a simple average?
A simple average gives every value the same importance. A weighted average gives each value an importance you choose.
Can weights be negative?
Not for an average in the usual sense. Negative weights can produce results outside the range of the values.
How do I weight by percentage?
Multiply each value by its percentage as a decimal and add the results.