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.
What Is a Weighted Average and How Do You Calculate It?
A weighted average is a mean in which each value counts for a different amount, set by its weight. To calculate it, multiply each value by its weight, add all those products, then divide by the sum of the weights [1]. That single sentence is the whole method, and everything below is just detail on how to apply it.
The formula is written $\bar{x}_w = \dfrac{\sum x_i w_i}{\sum w_i}$, where $x_i$ are the values and $w_i$ are their weights [1]. The top of the fraction (the numerator) is the total of the weighted contributions. The bottom (the denominator) is the total weight. Dividing one by the other rescales the answer so it behaves like an ordinary average.
A quick way to picture it: imagine each value is repeated a number of times equal to its weight. A value with weight 3 appears three times in the list, a value with weight 1 appears once. The weighted average is the plain average of that expanded list. This is why a heavier item pulls the result toward itself.
Weights do not have to be percentages or fractions, and they do not have to add up to 1. Only the ratio between weights matters. Using weights of 2, 3 and 5 gives exactly the same answer as using 0.2, 0.3 and 0.5, because 2:3:5 is the same ratio as 0.2:0.3:0.5. When the weights do sum to 1, the numerator is already the answer and you can skip the division.
A plain average is the special case where every weight equals 1 [1]. Then the denominator is just the count of values, which is why "add them up and divide by how many" works for unweighted data.
| Situation | What to do |
|---|---|
| Weights sum to 1 | Divide the total contribution by 1, so the numerator is the answer |
| Weights sum to something else | Divide the total contribution by the sum of the weights |
| All weights equal | The result equals the plain average |
| Weights given as percentages | Convert to decimals or use the raw numbers consistently |
To figure a weighted average by hand, keep the values and weights in two matched columns, work down the list multiplying each pair, then add each column and divide. For longer lists a spreadsheet is faster and less error prone. In Excel or Google Sheets, =SUMPRODUCT(values,weights)/SUM(weights) does the whole calculation in one cell [2].
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.
Weighted Average Formula Explained Line by Line
The formula has three moving parts, and understanding each one removes most of the confusion around weighted averages.
The value times weight product. Each term $x_i w_i$ is one value's contribution. It answers the question "how much does this item add to the total?" A score of 90 with weight 0.4 contributes 36. A score of 70 with weight 0.1 contributes 7. The contribution is not the value itself; it is the value scaled by how much it matters.
The numerator. Adding all the contributions, $\sum x_i w_i$, gives a single number that mixes every value in proportion to its weight. On its own this number has no meaning as an average, because it has not been rescaled.
The denominator. Adding all the weights, $\sum w_i$, gives the total influence across all items. Dividing the numerator by this total is what turns the mixed total back into an average on the same scale as the original values.
A useful check: if every value were identical, say all 80, the weighted average must also be 80. Plug it in and the numerator becomes $80 \times \sum w_i$, which divided by $\sum w_i$ gives 80. Any method that fails this check has an error.
Why Dividing by the Weight Total Matters
Suppose you have values 10, 20 and 30 with weights 1, 2 and 3. The contributions are 10, 40 and 90, which add to 140. The weights add to 6. The weighted average is $140 / 6 = 23.33$. Notice this sits closer to 30 than to 10, because 30 carries the largest weight. If you had wrongly divided by 3 (the count of values), you would get 46.67, a number larger than every value in the list. That impossible result is the telltale sign of dividing by the wrong denominator.
What the Weights Actually Mean
Weights express relative importance, not absolute amounts. A weight of 4 means "counts four times as much as a weight of 1," nothing more. This is why you can scale all weights up or down by the same factor without changing the answer. Doubling every weight doubles both the numerator and the denominator, and the ratio stays the same.
Worked Examples Across Common Situations
Different settings use weighted averages in slightly different clothing. These examples show the same method applied three ways.
Example: Grade Point Average by Credits
A student takes three courses. Course A is 4 credits with a grade point of 3.0. Course B is 3 credits with a grade point of 4.0. Course C is 2 credits with a grade point of 2.0.
Multiply each grade point by its credits: $3.0 \times 4 = 12$, $4.0 \times 3 = 12$, $2.0 \times 2 = 4$. The contributions add to 28. The credits add to 9. The GPA is $28 / 9 = 3.11$. The plain average of the three grade points would be $(3.0 + 4.0 + 2.0)/3 = 3.00$. The credit weighted result is higher because the strongest grade sits in a course worth more credits [1].
Example: Average Price Paid for Shares
An investor buys 100 shares at \$10, 50 shares at \$12, and 150 shares at \$8. The total spent is $100 \times 10 + 50 \times 12 + 150 \times 8 = 1000 + 600 + 1200 = 2800$. The total shares are $100 + 50 + 150 = 300$. The average price per share is $2800 / 300 = 9.33$. Here the weight is the number of shares, not the price. The plain average of the three prices, \$10, would overstate what was actually paid, because most shares were bought at the lower price.
Example: Weighted Average of a Frequency Table
When data arrive as counts, the count is the weight. Suppose a survey records heights in whole inches: 60 inches appears 3 times, 62 inches appears 5 times, and 65 inches appears 2 times. The contributions are $60 \times 3 = 180$, $62 \times 5 = 310$, $65 \times 2 = 130$, adding to 620. The total count is 10. The weighted average height is $620 / 10 = 62$ inches. This is exactly the ordinary mean of the ten individual measurements, because each repeated value is counted once per occurrence.
Example: Weights That Do Not Sum to 1
Values 5, 7 and 9 with weights 2, 3 and 5. Contributions: $5 \times 2 = 10$, $7 \times 3 = 21$, $9 \times 5 = 45$, total 76. Weights total 10. Weighted average $76 / 10 = 7.6$. Using the equivalent decimal weights 0.2, 0.3 and 0.5 gives contributions 1, 2.1 and 4.5, total 7.6, and the weights sum to 1, so the numerator is the answer. Both routes agree, which confirms that only the ratio of weights matters.
Weighted Averages With Probability Weights
A common tutorial question asks how to find an average height when each height is paired with a probability rather than a simple count. The method is identical, because probabilities are just weights that happen to sum to 1.
Setting Up the Calculation
Suppose a genetics problem gives possible heights for offspring and the probability of each. For instance, a height of 60 inches with probability 0.25, 64 inches with probability 0.50, and 68 inches with probability 0.25. Multiply each height by its probability: $60 \times 0.25 = 15$, $64 \times 0.50 = 32$, $68 \times 0.25 = 17$. The contributions add to 64. Because the probabilities sum to 1, the weighted average height is 64 inches, and no further division is needed.
Why This Is Called an Expected Value
When the weights are probabilities that sum to 1, the weighted average has a special name: the expected value. It represents the long run average you would see if the random process repeated many times. The arithmetic is the same as any weighted average; only the interpretation changes. This is why the probability weighted height example is really a weighted average in disguise.
A Check for Probability Weights
Probabilities must be between 0 and 1 and must sum to 1. If your weights sum to something other than 1, either you have made an error or they are not true probabilities. In that case, fall back on the full formula and divide by the weight total.
Common Misconceptions About Weighted Averages
Several beliefs about weighted averages are widespread and wrong. Clearing them up prevents most calculation errors.
Misconception: Weights Must Be Percentages
Weights can be any positive numbers. Percentages are convenient when the total is meant to represent a whole, but raw counts, credits, shares or probabilities all work. The only requirement is that the weights reflect relative importance and that you divide by their total.
Misconception: A Weighted Average Always Falls Between the Smallest and Largest Value
This holds when all weights are positive. A negative weight flips the sign of that value's contribution and can push the result outside the range of the original values. Negative weights appear in some financial and statistical methods, but for grades, prices and survey data they are almost always a mistake.
Misconception: The Weighted Average Is Always More Accurate
A weighted average is only as good as its weights. If the weights are arbitrary or based on a flawed source, the result inherits that flaw no matter how carefully the arithmetic is done. A plain average can be the better choice when there is no defensible reason to treat items differently.
Misconception: You Can Drop Items With No Weight
A missing weight is not the same as a weight of zero. If an item should not count, remove it from both the value list and the weight list. Leaving a value in place with no matching weight breaks the pairing and corrupts the result.
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. Krzywinski M, Altman N (2013). Importance of being uncertain. Nature Methods