Weighted Average Calculator Formula
Understand the math behind the weighted average calculator. Each variable explained with a worked example.
Formulas Used
Weighted Avg
weighted_avg = (w1 + w2 + w3 + w4) != 0 ? (v1*w1 + v2*w2 + v3*w3 + v4*w4) / (w1 + w2 + w3 + w4) : 0Total Weight
total_weight = w1 + w2 + w3 + w4Simple Avg
simple_avg = w4 > 0 ? (v1 + v2 + v3 + v4) / 4 : (v1 + v2 + v3) / 3Variables
| Variable | Description | Default |
|---|---|---|
v1 | Value 1 | 85 |
w1 | Weight 1 | 3 |
v2 | Value 2 | 92 |
w2 | Weight 2 | 4 |
v3 | Value 3 | 78 |
w3 | Weight 3 | 2 |
v4 | Value 4 (0 to skip) | 0 |
w4 | Weight 4 | 0 |
How It Works
Weighted Average
Formula
Weighted Average = (v₁w₁ + v₂w₂ + ... + vₙwₙ) / (w₁ + w₂ + ... + wₙ)
Each value is multiplied by its weight, summed, then divided by the total weight.
When to Use
Use weighted averages when different items contribute unequally: course grades (different credit hours), stock portfolio returns (different investment amounts), or survey responses (different sample sizes).
Worked Example
Three scores: 85 (weight 3), 92 (weight 4), 78 (weight 2).
v1 = 85w1 = 3v2 = 92w2 = 4v3 = 78w3 = 2v4 = 0w4 = 0
- 01Weighted sum = 85×3 + 92×4 + 78×2 = 255 + 368 + 156 = 779
- 02Total weight = 3 + 4 + 2 = 9
- 03Weighted average = 779/9 ≈ 86.5556
- 04Simple average = (85+92+78)/3 = 85
Ready to run the numbers?
Open Weighted Average Calculator