Math Tools Math Tools

How to Calculate a Weighted Average

How to Calculate a Weighted Average

By Math Tools ·

How to Calculate a Weighted Average

You scored 92 on homework, 85 on the midterm and 78 on the final exam. Your average is (92 + 85 + 78) / 3 = 85, right?

Not if the final exam counts for half your grade. With homework at 20%, the midterm at 30% and the final at 50%, your actual grade is 82.9. That's the difference between a B and a B−.

When some values matter more than others, a simple average gives the wrong answer. You need a weighted average.


A Simple Average Is Also a Weighted Average

A simple average isn't a different kind of calculation. It's a weighted average where every value gets the same weight. With three scores, each weight is 1/3.

Recognizing that makes the question clear: are all your values really equally important? If not, a simple average is quietly using the wrong weights.


The Formula

Weighted average = (w₁x₁ + w₂x₂ + … + wₙxₙ) ÷ (w₁ + w₂ + … + wₙ)
  • xᵢ are the values
  • wᵢ are their weights

If the weights already add up to 1 (or 100%), the division step is just dividing by 1, so you can skip it.


Example 1: A Course Grade

Component Score Weight
Homework 92 20%
Midterm 85 30%
Final exam 78 50%

Multiply each score by its weight, then add:

92 × 0.20 = 18.4
85 × 0.30 = 25.5
78 × 0.50 = 39.0
Total = 82.9

Your grade is 82.9. The weights add up to 100%, so no further division is needed.


Example 2: GPA

Grade points are weighted by credit hours:

Course Grade points Credits
Calculus 4.0 (A) 3
Chemistry 3.0 (B) 4
History 3.7 (A−) 3
Art 2.0 (C) 2
Weighted sum = 4.0×3 + 3.0×4 + 3.7×3 + 2.0×2 = 12 + 12 + 11.1 + 4 = 39.1
Total credits = 3 + 4 + 3 + 2 = 12
GPA = 39.1 ÷ 12 ≈ 3.26

A simple average of the four grades would give 3.18, underweighting the 4-credit chemistry course and overweighting the 2-credit art course. Check the arithmetic with the basic calculator.


Example 3: Average Price per Share

You bought shares in three purchases:

Purchase Price Shares
1 $40 100
2 $50 50
3 $30 150
Total cost = 40×100 + 50×50 + 30×150 = 4,000 + 2,500 + 4,500 = 11,000
Total shares = 300
Average price = 11,000 ÷ 300 ≈ $36.67

The simple average of the three prices is $40, which would overstate your cost basis because most shares were bought at $30.


An Insider Reference: Weighted Averages That Move Markets

Stock market indexes. The S&P 500, launched in its 500-company form in 1957, is weighted by market capitalization: bigger companies count more. In recent years, a handful of the largest technology companies have made up a large share of the index's total weight, so their price moves can shift the whole index.

Inflation. The Consumer Price Index is a weighted average of price changes, with weights based on how much households spend on each category. Housing carries far more weight than, say, postage.

The idea goes back to German economist Étienne Laspeyres, who in 1871 proposed a price index weighted by quantities purchased in a base period, the Laspeyres index. Versions of it are still used by statistical agencies around the world. See The Mathematics of Inflation.


When to Use a Weighted Average

Use a weighted average whenever values represent different amounts of something:

  • Scores with different importance (grades, performance reviews)
  • Rates from groups of different sizes (average speed, conversion rates)
  • Prices at different quantities (cost basis, average price paid)
  • Survey results from over- or under-represented groups

Watch out for averaging percentages. If Store A converts 10% of 1,000 visitors and Store B converts 30% of 100 visitors, the combined rate isn't 20%. It's (100 + 30) ÷ 1,100 ≈ 11.8%. Weight by the number of visitors. See Why Averages Can Lie.


Two Concepts Worth Knowing

Normalization

Normalizing weights means scaling them to add up to 1. Credits of 3, 4, 3 and 2 become 0.25, 0.333, 0.25 and 0.167. The weighted average doesn't change.

Expected Value

In probability, the expected value is a weighted average where the weights are probabilities. A game paying $10 with probability 0.3 and $0 otherwise has an expected value of $3. See the statistics formulas.


Quick Answer: How Do You Calculate a Weighted Average?

Multiply each value by its weight, add up the results, and divide by the sum of the weights. For example, scores of 92, 85 and 78 weighted 20%, 30% and 50% give 92×0.2 + 85×0.3 + 78×0.5 = 82.9. If the weights already sum to 1, you don't need to divide.


Try Them Yourself

Pull up your last report card or a course syllabus, find the grade weights, and calculate your weighted grade. Then compare it with the simple average.