Weighted Mean Calculator
An average where some values count for more than others.
The formula
w — the weight attached to it
Multiply each value by its weight, add the products, and divide by the total weight. When all the weights are equal the formula collapses to the ordinary arithmetic mean, which is the special case where everything counts the same.
The weights do not have to add up to 100, or to 1, or to anything in particular. Only their relative sizes matter — 20, 30, 50 and 2, 3, 5 give identical answers.
When you need one
- Course grades. A final exam worth 50% and two assignments worth 25% each.
- Grade point averages. Each course's grade weighted by its credit hours.
- Combining groups. Averaging the means of three classes of different sizes — the unweighted average of the means is wrong unless the classes are the same size.
- Portfolio returns. Each holding's return weighted by its share of the total value.
- Price indices. Each item's price change weighted by how much people actually buy.
The common thread is that the values represent different amounts of something, and treating them as equal would misrepresent the total.
Worked examples
A course grade
Products: 90 × 20 = 1800, 80 × 30 = 2400, 70 × 50 = 3500. Total 7700, total weight 100.
Weighted mean = 7700 ÷ 100 = 77. The unweighted mean would be 80 — three marks higher, because it gives the weakest score, which carries half the grade, the same say as the strongest, which carries a fifth.
A GPA from credit hours
Products: 12.0, 12.0, 11.1, 5.4 — total 40.5 across 12 credit hours.
GPA = 40.5 ÷ 12 = 3.375. The unweighted average of the four grades is 3.35; the four-credit course pulling the average down is what accounts for the difference.
Questions
What if my weights do not add up to 100?
That is fine. The formula divides by the total weight whatever it is, so 3, 4, 3, 2 credit hours works exactly as well as percentages.
Can a weight be zero?
Yes — that value is then simply excluded from the result. All the weights being zero is the one case with no answer, since the divisor would be zero; the calculator reports that rather than showing a number.
Can weights be negative?
The arithmetic allows it, and it appears in finance for short positions. Interpret the result carefully: with mixed signs the weighted mean can fall outside the range of your values, which is never true when all weights are positive.