IQR Calculator

Weighted Mean Calculator

An average where some values count for more than others.

Weighted mean calculatorRuns entirely in your browser
One value per entry. The weights below must line up one-for-one.
Any units — percentages, credit hours, counts. They do not need to add to 100.
Try:
Resultn = 3
Weighted mean777700 ÷ 1003 values
Pairs
3
Σ(value × weight)
7700
Σ weights
100
Weighted mean
77
Unweighted mean
80
Difference
-3

Contribution of each pair

ValueWeightShareValue × weight
902020%1800
803030%2400
705050%3500
Total100100%7700

How we calculated it

Multiply each value by its weight
90 × 20 = 180080 × 30 = 240070 × 50 = 3500
Σ(value × weight) = 7700
Add the weights
Σweights = 100
Divide
weighted mean = 7700 ÷ 100 = 77
The weights do not need to add up to 100 — only their ratios matter.

The formula

weighted mean = Σ(x × w) ÷ Σw x — each value
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

Scores 90, 80, 70 with weights 20%, 30%, 50%

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

Grades 4.0, 3.0, 3.7, 2.7 with credits 3, 4, 3, 2

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.