KajoData / Excel
Weighted average in Excel: values, weights and group means
I work through grades, customer groups and unit prices, showing how the choice of weights changes the question your average answers.

Two customer groups rated a service. The first group averaged 5, the second averaged 3. Is the overall average 4? Before answering, I want to know how many responses each group contains. Two opinions and two hundred opinions make very different contributions to a combined result.
A weighted average lets me express that difference. I will use small synthetic examples that you can follow on paper, then put the calculation into Excel. Most of the work goes into choosing the weights. The formula is short. Deciding what the result actually represents takes more care.
What a weight means
In an ordinary arithmetic mean, each observation has the same influence. I add the values and divide by the number of observations. For a weighted average, I multiply each value by its weight, add those products, then divide by the total weight.
Throughout this guide, weights are nonnegative and at least one is positive. A zero weight gives a value no influence on the average. A weight of two gives twice the influence of a weight of one. Whether that represents two people, two items or a policy decision depends on the analysis.
For an average purchase price, the weight might be the number of units purchased. When combining group means, it can be the number of responses in each group. In a school grading system, a teacher might give a test more weight than a homework assignment. The arithmetic has the same shape, but each calculation answers a different question.
I make that definition visible in a report. “Average rating weighted by response count” tells the reader more than “average.” This becomes especially useful when another metric on the same page uses sales value or customer priority as its weight.
Five grades and one calculation
Let us start with synthetic school grades. Tests have a weight of 2 and homework has a weight of 1. That is an assumption for this example, rather than a recommendation for every classroom.
| Grade | Weight | Grade times weight |
|---|---|---|
| 4 | 2 | 8 |
| 3 | 2 | 6 |
| 5 | 1 | 5 |
| 5 | 1 | 5 |
| 4 | 1 | 4 |
The numerator is 8 + 6 + 5 + 5 + 4, which is 28. The denominator is 2 + 2 + 1 + 1 + 1, which is 7. The weighted average is 28 / 7 = 4.
The ordinary average of the five grades is 21 / 5 = 4.2. The weighted result is lower because the grades 4 and 3 have greater influence. Excel has not invented an extra penalty. It is following the weighting system that we chose.
Watch the denominator. I divide by 7, rather than by the five rows. Multiplying by weights and then dividing by the number of grades would produce a different quantity. It is an easy mistake when assembling the calculation manually.
The weighted average formula in Excel
Put the headings Grade and Weight into A1:B1 and the five pairs into A2:B6. Both columns should contain actual numbers. In English Excel, I use:
=SUMPRODUCT(A2:A6,B2:B6)/SUM(B2:B6)
The Polish names are SUMA.ILOCZYNÓW and SUMA. Argument separators depend on regional settings. English examples here use commas; Polish examples use semicolons.
Microsoft demonstrates the same construction in its guide to calculating an average. The numerator adds the products of matching values and weights. The denominator adds the weights. For our five rows, the result is 4.
When setting this up for the first time, I often keep a helper column. In C2, I enter =A2*B2 and copy it down to C6. I can see 8, 6, 5, 5 and 4. That makes a mistyped weight easier to spot. Once the calculation makes sense, I can use the compact formula.
The ranges need matching dimensions and corresponding rows. The SUMPRODUCT documentation describes both the dimension requirement and the treatment of nonnumeric array entries as zeros. I therefore check imported data before calculating. Text that looks like a number can leave part of the intended contribution out of the numerator while still producing a plausible result.
Do weights have to add up to one?
Our weights add up to 7. They do not have to add up to 1 or 100. Dividing by their sum normalizes their contribution.
I could replace 2, 2, 1, 1, 1 with 20, 20, 10, 10, 10. Every weight would become ten times larger. The numerator and denominator would grow by the same factor, so the answer would remain 4. Their scale would change while their proportions stayed the same.
If the weights are percentage shares that add up to 100%, the sum of the weighted values already gives the average. I still often leave the division in place: it shows the complete definition and keeps the formula usable if the scale of the weights changes.
That does not mean a missing 10% is harmless. If a model requires specific shares but they add up to 90%, I first investigate the missing part. Normalizing automatically could hide an omitted category. Correct arithmetic on incomplete data still describes incomplete data.

Why averaging averages can mislead
Return to our two customer groups. In the synthetic data, group A has 2 ratings with an average of 5. Group B has 8 ratings with an average of 3. Averaging those two means gives 4, assigning equal influence to each group.
For the average of all ten ratings, I need another calculation. Two ratings averaging 5 have a total of 10. Eight ratings averaging 3 have a total of 24. Together they give 34 points, so the combined average is 34 / 10 = 3.4.
| Group | Average rating | Number of ratings |
|---|---|---|
| A | 5 | 2 |
| B | 3 | 8 |
In Excel, I can use the same weighted formula, putting group averages in the first range and response counts in the second. The groups should contain appropriate, nonoverlapping observations of the same kind. Counting someone twice gives that person twice the influence, regardless of how neatly I write the formula.
If the group means have already been rounded, reconstructing the combined result gives an approximation. A displayed average of 3.4 could come from several different totals. For precise reporting, I prefer retaining the sum of ratings and the count. That avoids trying to recover detail from a rounded metric.
Choosing a weight changes the business question
Suppose I divide customers into standard and VIP groups, then give each VIP rating a weight of 2. I get an index weighted according to that policy. I should label it accordingly, rather than presenting it as the average opinion of customers with equal influence per person.
If my question concerns respondent satisfaction, one response with the same weight as another is a natural starting point. If I want a particular group to matter more, I explain why. Higher customer spending does not establish a universal statistical weighting rule.
Purchase prices offer another useful example. I buy 2 units at 10 and 8 units at 5. The total cost is 20 + 40 = 60 for ten units. The average unit price is 6. Averaging the two prices directly would give 7.5, assigning equal weight to the two purchases without accounting for quantity.
I check the units too. If one purchase is recorded in individual items and another in packs of ten, I convert them to a common unit first. Excel will multiply both numbers without asking what a pack means. That part is my responsibility.
Missing values and a zero denominator
A zero and a missing value mean different things. A rating of 0 may be a valid response on the chosen scale. An empty cell may mean no response. Before giving them the same treatment, I establish the rules for the dataset.
A missing rating paired with a positive weight is particularly risky. If the numerator gets no contribution from the rating but the denominator retains its weight, the average falls. My preparation rule is simple: both ranges should cover the same approved set of complete value-weight pairs.
If the total weight is zero, this weighted average is undefined. Division by zero does not establish an average of zero. I report that there is no basis for calculating the metric and check why all the weights are zero.
I avoid immediately wrapping every problem in a formula that substitutes zero for errors. That can turn a broken import into a tidy metric. I first establish the cause, then decide how to display the missing result. My data cleaning guide covers the broader preparation process.
Checking whether the result makes sense
With nonnegative weights and a positive total weight, the average should fall between the smallest and largest included values. A result of 8 for grades ranging from 3 to 5 sends me back to the denominator and ranges. This is a quick reasonableness check, rather than a complete data audit.
I also check the direction of change. Increasing only the weight of a low rating should pull the combined average towards that rating. If it rises instead, I may have mixed up a range, a column or the definition of the weight.
For grouped data, I keep counts next to averages. An average of 5 from one response has a different foundation from 4.8 based on many responses. A weighted average combines groups, but it does not by itself describe variation, sampling quality or uncertainty. For uneven distributions, the median can be useful alongside it.
A small exercise
Take two synthetic groups: an average of 2 from one response, and an average of 4 from three responses. Recover the totals first: 2 and 12. Together, that is 14 points from four responses, giving an average of 3.5.
Then change the first group’s count from 1 to 3 while keeping both group averages unchanged. The groups now have equal weight. The result should be halfway between 2 and 4, which is 3.
For your own report, write three things beside the formula: what the value represents, what the weight represents and which rows were excluded. If another person understands those statements, they have a much better chance of reading the average correctly.
Key takeaways
Do weights need to add up to one?
No. Dividing by their sum normalizes the weights, provided the total is positive.
Can I average group averages?
For the mean of all individual observations, weight group means by their counts and use nonoverlapping groups.
What if the total weight is zero?
The weighted average is undefined. Investigate the data and report the missing basis for calculation.
AI was used in an automated way while working on this article. If you want to learn how to do it too, check out this project.
