Weighted Mean Calculator Formula
Understand the math behind the weighted mean calculator. Each variable explained with a worked example.
Formulas Used
Weighted Mean
weighted_mean = weighted_sum / weight_totalTotal Weight
total_weight = weight_totalVariables
| Variable | Description | Default |
|---|---|---|
v1 | Value 1 | 85 |
w1 | Weight 1 | 3 |
v2 | Value 2 | 90 |
w2 | Weight 2 | 4 |
v3 | Value 3 | 78 |
w3 | Weight 3 | 2 |
weighted_sum | Derived value= v1 * w1 + v2 * w2 + v3 * w3 | calculated |
weight_total | Derived value= w1 + w2 + w3 | calculated |
How It Works
How to Compute a Weighted Mean
Formula
Weighted Mean = (v1*w1 + v2*w2 + ... + vn*wn) / (w1 + w2 + ... + wn)
Each value is multiplied by its weight before summing. The result is then divided by the sum of all weights. This is useful when some observations matter more than others, such as course grades with different credit hours.
Worked Example
A student scores 85 (3 credits), 90 (4 credits), and 78 (2 credits). What is the weighted GPA?
- 01Weighted sum = 85*3 + 90*4 + 78*2 = 255 + 360 + 156 = 771
- 02Total weight = 3 + 4 + 2 = 9
- 03Weighted mean = 771 / 9 = 85.6667
When to Use This Formula
- Calculating a GPA where different courses carry different credit hours — a 4-credit A matters more than a 1-credit B.
- Computing a portfolio return where each asset has a different allocation weight based on the amount invested.
- Aggregating survey scores where some respondent groups are oversampled and must be weighted to reflect the true population distribution.
- Combining scores from different evaluation criteria (e.g., 40% exam, 30% project, 30% participation) into a single final grade.
- Calculating the average cost of inventory using the weighted average method, where purchase batches at different prices contribute proportionally to the total.
Common Mistakes to Avoid
- Forgetting to divide by the sum of the weights — the weighted mean formula is the sum of (weight × value) divided by the sum of all weights, not just the sum of (weight × value) alone.
- Using equal weights when the data calls for unequal weighting — averaging group means directly without accounting for different group sizes (Simpson's paradox) can reverse the apparent direction of a trend.
- Expressing weights inconsistently — if some weights are percentages and others are raw counts, the result is meaningless. All weights must be in the same unit or scale before calculating.
- Confusing weights with values — in a GPA calculation, the credit hours are the weights and the grade points are the values. Swapping them produces a nonsensical number.
Frequently Asked Questions
How does a weighted mean differ from a simple mean?
A simple mean treats every value equally. A weighted mean multiplies each value by an importance factor (weight) before averaging, so higher-weight observations influence the result more.
What happens if all weights are equal?
When every weight is the same, the weighted mean reduces to the ordinary arithmetic mean.
Can weights be fractions or decimals?
Yes. Weights can be any non-negative number, including fractions and decimals. Only the relative proportions of the weights matter.
Ready to run the numbers?
Open Weighted Mean Calculator