# Weighted Arithmetic Mean: Formula and Examples

The weighted arithmetic mean is an average in which each data value is multiplied by a weight before you sum the results. You use it when some observations should count more than others, such as exam scores with different credit values or a stock bought at several prices [1]. It is a special case of the ordinary arithmetic mean, which gives every observation the same influence [2].

## Quick Answer

- Formula: $\bar{x}_w = \dfrac{\sum_{i=1}^{n} w_i x_i}{\sum_{i=1}^{n} w_i}$, the sum of each value times its weight, divided by the sum of the weights [1].
- Use it when observations differ in importance, size, or the number of units they represent [3].
- If every weight is equal, the weighted arithmetic mean equals the simple arithmetic mean.
- Weights can be counts, proportions, dollar amounts, or any positive number. They do not have to sum to 1.
- In the worked example below, scores of 75, 82 and 90 with weights 0.2, 0.3 and 0.5 give a weighted mean of 84.6000, against a simple mean of 82.3333.

## The Formula

$$\bar{x}_w = \frac{\sum_{i=1}^{n} w_i x_i}{\sum_{i=1}^{n} w_i}$$

Each symbol means the following.

| Symbol | Meaning |
|---|---|
| $\bar{x}_w$ | The weighted arithmetic mean |
| $x_i$ | The $i$-th data value |
| $w_i$ | The weight assigned to the $i$-th data value |
| $n$ | The number of data values |
| $\sum$ | Summation over all values from $i = 1$ to $n$ |

The numerator is the sum of the products $w_i x_i$. The denominator is the sum of the weights. Dividing by $\sum w_i$ is what makes the result an average instead of a total, and it is why the weights do not need to sum to 1.

When all weights are equal, say $w_i = c$ for every $i$, the formula reduces to $\frac{c \sum x_i}{c n} = \frac{\sum x_i}{n}$, which is the simple arithmetic mean [2].

## How to Calculate It Step by Step

1. List your data values in one column and their weights in a second column [1].
2. Multiply each value by its weight to get a product for every row.
3. Add all the products together.
4. Add all the weights together.
5. Divide the sum of products by the sum of weights.

If the weights already sum to 1, step 5 is just the sum of products, because dividing by 1 changes nothing.

## Worked Example

A student has three exam scores, and each exam counts for a different share of the final grade.

| Exam | Score ($x$) | Weight ($w$) | Product ($x \cdot w$) |
|---|---|---|---|
| Exam 1 | 75 | 0.2 | 15.0 |
| Exam 2 | 82 | 0.3 | 24.6 |
| Exam 3 | 90 | 0.5 | 45.0 |

The scores are $[75, 82, 90]$ and the weights are $[0.2, 0.3, 0.5]$.

Step 1. Check the sum of the weights: $0.2 + 0.3 + 0.5 = 1.0$.

Step 2. Multiply each score by its weight: $75 \times 0.2 = 15.0$, $82 \times 0.3 = 24.6$, $90 \times 0.5 = 45.0$.

Step 3. Add the products: $15.0 + 24.6 + 45.0 = 84.6$.

Step 4. Divide by the sum of the weights: $84.6 / 1.0 = 84.6000$.

The weighted mean is 84.6000. The simple unweighted mean of the same three scores is $(75 + 82 + 90) / 3 = 82.3333$. The difference is $84.6000 - 82.3333 = 2.2667$. The weighted result is higher because the best score carries the largest weight.

Here is the same calculation in Python.

```python
scores  = [75, 82, 90]
weights = [0.2, 0.3, 0.5]
weighted_mean = sum(s*w for s, w in zip(scores, weights)) / sum(weights)
print(f"{weighted_mean:.4f}")  # 84.6000
```

Output:

```text
84.6000
```

## How to Interpret the Result

The weighted mean of 84.6000 is the single score that, earned on all three exams, would produce the same final grade. It is a single number that summarizes performance while respecting the fact that Exam 3 matters more than Exam 1.

Read it as a balance point. Each value pulls the average toward itself with a force proportional to its weight. A weight of 0.5 gives Exam 3 half the total influence, so a strong or weak score there moves the result more than the same score on Exam 1.

Compare the weighted mean with the simple mean to see the effect of the weights. A gap of 2.2667 points here comes entirely from the weighting scheme, not from the scores themselves. If the weights had been equal, the two averages would have matched exactly.

The weighted mean is still a mean, so it is sensitive to extreme values. One very large score with a large weight can pull it far from the rest of the data, just as an outlier pulls the simple mean [2]. If that is a concern, look at the median or a trimmed mean instead.

## Doing It in Software

**Excel.** The `SUMPRODUCT` function multiplies matching ranges and adds the results, so `=SUMPRODUCT(scores, weights)/SUM(weights)` returns the weighted mean. If your weights already sum to 1, `=SUMPRODUCT(scores, weights)` is enough. A full walkthrough with cell references is in [Weighted Average in Excel: Formula and Examples](/blog/data-analysis/weighted-average-in-excel).

**R.** The base `stats` package includes `weighted.mean(x, w)`, where `x` holds the values and `w` holds the weights [4]. If you omit `w`, all elements get the same weight and the result is the ordinary mean. Zero weights are handled, but missing values in the weights produce a missing result [4].

**Python.** In Python 3.11 and later, the standard library function `statistics.fmean(values, weights=weights)` returns the weighted mean. You can also compute it directly with a generator expression as shown above. If you use NumPy, `numpy.average(values, weights=weights)` returns the same number.

To check a small dataset by hand, the [Mean, Median & Mode Calculator](/tools/mean-median-mode-calculator) gives you the unweighted mean for comparison.

## Common Mistakes

- **Forgetting to divide by the sum of the weights.** Multiplying and summing alone gives a weighted total, not a mean. Always divide by $\sum w_i$ unless the weights already sum to 1.
- **Using negative or zero weights carelessly.** A zero weight removes a value from the calculation, and negative weights can push the result outside the range of your data. Use non-negative weights unless you have a specific reason not to.
- **Mixing up weights and values.** The weight describes how much a value counts, not what the value is. Putting the score in the weight column and the weight in the score column gives a meaningless number.
- **Assuming the weighted mean must lie between the simple mean and the largest value.** It always lies between the smallest and largest values, but its position relative to the simple mean depends entirely on which values carry the most weight.
- **Using the weighted mean when weights are arbitrary.** If you cannot justify each weight with a real quantity such as credit hours, sample size, or surface area, the result is only as good as your guesses [3].
- **Ignoring missing data.** Software handles gaps differently. R's `weighted.mean` returns `NA` if a weight is missing, and in Excel a blank score counts as 0 in `SUMPRODUCT` while its weight still counts in `SUM`. Check for gaps before you compute.

## Limitations

The weighted arithmetic mean is only as meaningful as the weights you assign. Weights based on judgment rather than measurement introduce a subjective element that the simple mean does not have. Two analysts with different weighting schemes can report different averages from the same data, and neither is wrong on its own terms.

The method also assumes the weights are known exactly and apply to the whole value. It cannot correct for biased sampling, and it does not reduce the influence of outliers unless you deliberately down-weight them. When the underlying data are skewed or contain extreme cases, report the median or a trimmed mean alongside the weighted mean so readers can see how much the choice of measure matters [2].

## Frequently Asked Questions

### What is the difference between the weighted arithmetic mean and the simple arithmetic mean?

The simple arithmetic mean adds all values and divides by how many there are, giving every observation the same influence [2]. The weighted arithmetic mean multiplies each value by a weight first, then divides by the sum of the weights, so some observations count more than others [1]. When all weights are equal, the two produce the same result.

### Can the weights be percentages or counts?

Yes. Weights can be proportions, percentages, counts, dollar amounts, or any other positive number. The formula divides by the sum of the weights, so the scale does not matter. Weights of 20, 30 and 50 give the same answer as 0.2, 0.3 and 0.5.

### Do the weights have to add up to 1?

No. If they do, the denominator is 1 and you can skip the division. If they do not, dividing by $\sum w_i$ rescales the result correctly. This is why the formula works with raw counts such as the number of subsamples in each sample [3].

### When should I use the weighted mean instead of the median?

Use the weighted mean when each observation has a known, defensible weight and you want a single balance point that respects those weights. Use the median when the data are skewed or contain extreme values that would distort an average [2]. If both concerns apply, report both numbers.

### What happens if one weight is zero?

A zero weight removes that value from the calculation entirely, because its product is zero and it adds nothing to the denominator. This is a valid way to exclude an observation, but it should be a deliberate choice. In R, zero weights are handled without error, while missing weights produce a missing result [4].

### Is the weighted mean the same as the geometric mean?

No. The weighted arithmetic mean adds the weighted values, while the geometric mean multiplies them and takes a root. The geometric mean suits growth rates and ratios, and it has its own weighted form. For a comparison of the two, see [Geometric Mean: Definition, Formula and Examples](/blog/data-analysis/geometric-mean-definition-formula).

For related measures of center and spread, see [Mean and Standard Deviation: Definition, Formula and Examples](/blog/data-analysis/mean-and-standard-deviation) and [Standard Error of the Mean: Formula and Example](/blog/data-analysis/standard-error-of-the-mean-formula). If your data are rates or ratios instead of plain values, the [Harmonic Mean: Formula, Examples and When to Use It](/blog/data-analysis/harmonic-mean-formula) covers the appropriate alternative.

## References

1. [13.1 Measures of Center - Principles of Finance 2e | OpenStax](https://openstax.org/books/principles-finance-2e/pages/13-1-measures-of-center)
2. [Common Methods](https://datascience.emory.edu/research/common-methods.html)
3. [40 CFR § 745.63 - Definitions. | Electronic Code of Federal Regulations (e-CFR) | US Law | LII / Legal Information Institute](https://www.law.cornell.edu/cfr/text/40/745.63)
4. [R: Weighted Arithmetic Mean](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/weighted.mean.html)

## Further Reading

- [NIST/SEMATECH e-Handbook of Statistical Methods](https://www.itl.nist.gov/div898/handbook/index.htm)
- [OpenStax. Introductory Statistics 2e](https://openstax.org/details/books/introductory-statistics-2e)

## Related Articles

- [Weighted Average in Excel: Formula and Examples](/blog/data-analysis/weighted-average-in-excel)
- [Harmonic Mean: Formula, Examples and When to Use It](/blog/data-analysis/harmonic-mean-formula)
- [Geometric Mean: Definition, Formula and Examples](/blog/data-analysis/geometric-mean-definition-formula)
- [Standard Error of the Mean: Formula and Example](/blog/data-analysis/standard-error-of-the-mean-formula)
- [Binomial Distribution: Formula, Mean and Examples](/blog/data-analysis/binomial-distribution-formula-examples)
- [Residual Sum of Squares: Formula and Example](/blog/research-skills/residual-sum-of-squares-formula-and-example)
- [Mean Square Displacement: Formula and Examples](/blog/research-skills/mean-square-displacement-formula-and-examples)
- [P-Value Formula and Interpretation: A Researcher](/blog/guides/p-value-formula-and-interpretation-a-researcher-s-guide)