How to Calculate a Weighted Average (Step by Step)
By Dr. Zubair Khalid, DVM, MS, PhD ·

A weighted average is an average where each value counts for a different amount, set by its weight. You multiply each value by its weight, add those products, then divide by the sum of the weights. This article shows the weighted average formula, a full calculation by hand, and how to do the same thing in a spreadsheet.
Quick Answer
- The formula is $\bar{x}_w = \dfrac{\sum x_i w_i}{\sum w_i}$, where $x_i$ are the values and $w_i$ are the weights [1].
- Multiply each value by its weight to get its contribution.
- Add all the contributions to get the numerator.
- Add all the weights to get the denominator.
- Divide the numerator by the denominator. If the weights already sum to 1, the numerator is the answer.
Before You Start
You need two matched lists. One list holds the values you want to average. The other holds a weight for each value. The lists must line up, so the weight in position one belongs to the value in position one.
Weights can be any positive numbers. They do not have to be percentages or fractions. They do not have to sum to 1. What matters is the ratio between them. A value with weight 4 counts twice as much as a value with weight 2, and the final answer is the same whether you use 4 and 2 or 0.4 and 0.2.
A plain average, also called the arithmetic mean, is the special case where every weight equals 1 [1]. Then the denominator is just the count of values, and you get the familiar "add them up and divide by how many" result.
Check two things before you compute. First, every value has a weight. Second, no weight is negative unless you have a specific reason, because a negative weight flips the sign of that value's contribution and the result stops behaving like an average.
Step by Step
- Write down the values and weights. Put them in two columns so each pair stays together.
- Multiply each value by its weight. This gives the contribution of that value to the total.
- Add the contributions. This is the numerator, $\sum x_i w_i$.
- Add the weights. This is the denominator, $\sum w_i$.
- Divide the numerator by the denominator. The result is the weighted average.
- Check the weights. If they sum to 1, the numerator alone is your answer, which is a quick way to catch arithmetic slips.
The formula in one line:
$$\bar{x}_w = \frac{\sum_{i=1}^{n} x_i w_i}{\sum_{i=1}^{n} w_i}$$
Here $x_i$ is the i-th value and $w_i$ is its weight. The numerator is the sum of the weighted contributions, and the denominator is the total weight [1].
Worked Example
A student has three assignment scores, and each assignment counts for a different share of the final course grade.
| Assignment | Score | Weight |
|---|---|---|
| Homework | 88 | 0.2 |
| Midterm | 92 | 0.3 |
| Final | 85 | 0.5 |
Step 1, multiply each score by its weight:
- Homework: 88 × 0.2 = 17.60
- Midterm: 92 × 0.3 = 27.60
- Final: 85 × 0.5 = 42.50
Step 2, add the contributions:
$$17.60 + 27.60 + 42.50 = 87.70$$
Step 3, add the weights:
$$0.2 + 0.3 + 0.5 = 1.0$$
Step 4, divide:
$$\frac{87.70}{1.0} = 87.70$$
The weighted average is 87.70. Notice that the plain average of the three scores would be $(88 + 92 + 85) / 3 = 88.33$. The weighted result is lower because the final exam, where the score was 85, carries half the weight.
The same calculation in Python with NumPy:
import numpy as np
scores = np.array([88, 92, 85])
weights = np.array([0.2, 0.3, 0.5])
grade = np.dot(scores, weights)
print(f"{grade:.2f}") # 87.70
Output:
87.70
The np.dot function multiplies the two arrays element by element and adds the results, which is exactly the numerator of the weighted average formula. Because the weights sum to 1, no further division is needed.
Other Ways to Do It
Spreadsheet with SUMPRODUCT. In Excel or Google Sheets, put scores in one column and weights in another. The formula =SUMPRODUCT(A2:A4,B2:B4)/SUM(B2:B4) returns the weighted average. SUMPRODUCT handles the multiply-and-add step in one call, and dividing by SUM of the weights keeps the formula correct even when the weights do not sum to 1 [2]. If your weights already sum to 1, you can drop the division. See Weighted Average in Excel: Formula and Examples for the full walkthrough.
Spreadsheet with a helper column. Multiply each score by its weight in a third column, then sum that column and divide by the sum of the weights. This is slower but easier to audit, because you can see every contribution.
Statistical software. In R, the weighted.mean function takes a vector of values and a vector of weights and returns the weighted mean [3]. If you leave the weights out, it falls back to the plain mean [3].
By hand with a calculator. For a short list, the four steps above are faster than opening a spreadsheet. For anything longer than about ten values, a spreadsheet reduces typing errors.
If you want to compare the weighted result against the plain mean, median, and mode of the same values, the Mean, Median & Mode Calculator does all four at once.
Troubleshooting
The answer looks too high or too low. Check that each weight is paired with the right value. A swapped pair is the most common cause of a result that is off by a small but noticeable amount.
The answer equals the plain average. That happens when all weights are equal. It is not an error.
The denominator is zero. You have no weights, or they cancel out. A weighted average needs at least one positive weight.
The result is outside the range of your values. This points to a negative weight or a typo in one of the products. Recheck the contributions one at a time.
The spreadsheet returns an error. SUMPRODUCT requires the two ranges to be the same size. A mismatch in row counts is the usual culprit.
Common Mistakes
- Dividing by the number of values instead of the sum of the weights. The denominator is $\sum w_i$, not $n$. Fix: add the weights and use that total.
- Forgetting to divide at all. If the weights sum to 1, skipping the division is fine. If they sum to anything else, the numerator is not the average. Fix: always check the weight total first.
- Using percentages as weights without converting. A weight of 20 means twenty times the influence of a weight of 1, not twenty percent. Fix: divide percentages by 100, or use the raw numbers consistently.
- Mixing up which column is the value and which is the weight. Fix: label the columns and read the formula back to yourself before computing.
- Dropping a value that has no weight. A missing weight is not zero. Fix: decide whether the value should be excluded, and if so remove it from both lists.
- Assuming the weighted average must fall between the smallest and largest value. It does when all weights are positive, but a negative weight breaks that rule. Fix: avoid negative weights unless the method you are using calls for them.
Limitations
A weighted average summarizes a set of values with different importance into a single number. It cannot tell you how spread out the values are, whether one value dominates the result, or whether the weights themselves are justified. Two datasets with very different distributions can produce the same weighted average, so pair it with a measure of spread such as the standard deviation when the variability matters.
The choice of weights drives the answer, and that choice is often subjective. If the weights come from a flawed source, the weighted average inherits that flaw no matter how carefully you compute it. The method also assumes each value contributes linearly, so doubling a weight doubles that value's influence. That assumption may not hold in every setting.
Frequently Asked Questions
How do I calculate a weighted average when the weights do not sum to 1?
Use the full formula. Multiply each value by its weight, add the products, then divide by the sum of the weights. For example, weights of 2, 3, and 5 sum to 10, so you divide the total contribution by 10. The result is identical to using weights of 0.2, 0.3, and 0.5, because only the ratio between weights matters.
What is the difference between a weighted average and a simple average?
A simple average gives every value the same influence and divides by the count of values. A weighted average gives each value an influence set by its weight and divides by the total weight [1]. When all weights are equal, the two produce the same number.
Can a weighted average be calculated with negative weights?
Mathematically yes, but the result may fall outside the range of your values and is hard to interpret as an average. Most practical uses, such as grades, prices, and survey results, rely on positive weights. If you see a negative weight, confirm it is intentional before trusting the output.
How do I calculate a weighted average in Excel?
Use =SUMPRODUCT(values, weights)/SUM(weights), replacing values and weights with your cell ranges. SUMPRODUCT multiplies each pair and adds the products, and dividing by the sum of the weights normalizes the result [2]. If your weights already sum to 1, you can omit the division. The step-by-step Excel guide covers variations, including weighted averages inside a pivot table.
What is the weighted average formula in symbols?
The formula is $\bar{x}_w = \frac{\sum x_i w_i}{\sum w_i}$ [1]. The numerator sums each value multiplied by its weight, and the denominator sums the weights. The overbar on the left side signals that the result is a mean.
When should I use a weighted average instead of a plain mean?
Use a weighted average when the items you are averaging are not equally important. Grade point averages weight each course by its credits, and portfolio returns weight each holding by its value [1]. If every item deserves the same influence, a plain mean is simpler and correct. For a deeper look at the general form, see Weighted Arithmetic Mean: Formula and Examples.
References
- 7.1: Weighted Averages - Engineering LibreTexts/07%3A_Centroids_and_Centers_of_Gravity/7.01%3A_Weighted_Averages)
- Excel Calculate Weighted Average - Online Lesson
- R: Weighted Arithmetic Mean
Further Reading
- NIST/SEMATECH e-Handbook of Statistical Methods
- OpenStax. Introductory Statistics 2e
- Krzywinski M, Altman N (2013). Importance of being uncertain. Nature Methods