The weighted average formula gives each value a say in the result that matches its importance. A final exam worth half a course grade should count more than a quiz. Thirty shares bought at one price should count more than ten bought at another. A plain average treats every value the same, so it can point the wrong way.
This guide gives the formula, then works through three examples in US dollars with round numbers: a course grade, the average cost of shares, and the average interest rate across two loans. The same math works in any currency. It ends with the cases where a simple average misleads.
The Weighted Average Formula
Multiply each value by its weight, add up those products, then divide by the sum of the weights.
Weighted average = sum of (value × weight) ÷ sum of weights
In symbols, that is Σ(w × x) ÷ Σw, where x is each value and w is its weight. The NIST Dataplot reference for the weighted mean gives a separate formula for the weighted mean next to the standard formula for the mean, and defines w as the weight for each observation. It also notes that weighted means are often used for frequency data.
- List each value and its weight.
- Multiply each value by its weight.
- Add the products.
- Add the weights.
- Divide the first total by the second.
A quick check: the values 2 and 8 with weights 3 and 1 give (2 × 3 + 8 × 1) ÷ (3 + 1) = 14 ÷ 4 = 3.5. The simple average is 5. The heavier weight on 2 pulls the result toward 2.
Weights do not have to add up to 1 or 100. Dividing by their sum takes care of the scale. If they do add up to 1, the last step is dividing by 1, so it changes nothing.
Example 1: Course Grade With Weighted Assignments
Say a course counts homework as 20%, the midterm as 30% and the final exam as 50%. A student scores 95 on homework, 80 on the midterm and 70 on the final.

| Part | Score | Weight | Score × weight |
|---|---|---|---|
| Homework | 95 | 0.20 | 19 |
| Midterm | 80 | 0.30 | 24 |
| Final exam | 70 | 0.50 | 35 |
| Total | 1.00 | 78 |
The weighted average formula gives 78 ÷ 1.00 = 78. This matches the method in a University of Colorado Boulder grade worksheet: turn each item into a percentage, multiply it by its weight, then add the results.
Using whole percentages as weights gives the same answer. The products add up to 7,800, the weights add up to 100, and 7,800 ÷ 100 = 78.
The simple average of the three scores is 245 ÷ 3, about 81.7. That is about 3.7 points higher than the real grade, because it gives the low final exam the same pull as the homework.
Example 2: Average Cost of Shares Bought at Different Prices
This is pure arithmetic, not a view on any investment. Suppose someone buys 10 shares at $50 and later 30 more shares at $40. The value is the price per share, and the weight is the number of shares.

| Purchase | Price per share | Shares | Cost |
|---|---|---|---|
| First | $50 | 10 | $500 |
| Second | $40 | 30 | $1,200 |
| Total | 40 | $1,700 |
The average cost per share is $1,700 ÷ 40 = $42.50. The simple average of the two prices is $45. Multiply $45 by 40 shares and you get $1,800, which is $100 more than was actually paid. The weighted figure is the one that matches the money spent.
A note on wording. FINRA describes cost basis for stocks as generally the purchase price, plus costs such as commissions or other fees paid to complete the trade. This example leaves fees out to keep the math clear. Adding fees raises the total cost, and so the average cost per share.
Example 3: Weighted Average Interest Rate Across Two Loans
Take a $10,000 loan at 5% and a $20,000 loan at 7%. The rate is the value and the loan balance is the weight.
Applying the weighted average formula: weighted rate = ($10,000 × 5 + $20,000 × 7) ÷ ($10,000 + $20,000) = 190,000 ÷ 30,000, about 6.33%.
A quick test shows why this is the right number. In one year of simple interest, the two loans cost $500 and $1,400, or $1,900 in total. A single rate of 6.333…% on $30,000 also gives $1,900. The simple average of 6% would give only $1,800.
How US federal student loan consolidation uses it
For a US federal Direct Consolidation Loan, this is an official rule. The Federal Student Aid application and promissory note for a Direct Consolidation Loan says that, unless the borrower is told in writing that a different rate will apply, the rate will be the weighted average of the interest rates on the loans being consolidated, rounded to the nearest higher one-eighth of one percent. One eighth is 0.125, so 6.33…% rounds up to 6.375%.
That rounding step comes from the Direct Consolidation Loan terms. Without a rule like that, the weighted average rate of several loans is just a summary number. It is also not the same thing as APR. The guide to APR vs interest rate explains the difference.
When a Simple Average Misleads
A simple average is a weighted average where every weight is the same. It works when each value really does count equally. It goes wrong when the weights differ a lot, as the table shows.
| Example | Simple average | Weighted average |
|---|---|---|
| Course grade | about 81.7 | 78 |
| Cost per share | $45 | $42.50 |
| Loan rate | 6% | about 6.33% |
In each case the simple average ignores how much each value counts. The more uneven the weights, the bigger the gap. For a refresher on the plain mean, see the average formula guide. To see how spread out values are around an average, the standard deviation formula is the next step.
Common Mistakes With the Weighted Average Formula
- Not dividing by the sum of the weights. This only works without the division when the weights add up to 1.
- Mixing percent and decimal weights. Use 0.20 or 20 for every row, not a mix of both.
- Picking the wrong weight. For loans the weight is the balance, not the number of loans. For shares it is the number of shares, not the number of purchases.
- Rounding too early. Keep full figures until the last step, then round once.
Percent weights often come from a share of a total. The guide on how to calculate a percentage of a number covers that step, and the percentage calculator can check it.
Conclusion
The weighted average formula is sum of (value × weight) divided by sum of weights. It gives a course grade that follows the syllabus, a cost per share that matches the money spent, and a loan rate that matches the interest charged. When values do not count equally, the weighted average formula gives the figure that reflects them. A simple average is only safe when every weight is the same.


