FORMULAS & FUNCTIONS
How to Calculate a Weighted Average in Excel with SUMPRODUCT
Give each value the influence it deserves. Use SUMPRODUCT to multiply prices by their quantities, then divide by the total quantity.

Why use a weighted average?
A regular average gives every value equal influence. A weighted average accounts for how much each value represents. For example, if you bought 50 units at $5, 30 at $7, and 20 at $8, the 50-unit purchase should affect your average more than the 20-unit purchase.
The same method works for average cost, scores with different credit hours, or any set of values paired with a meaningful weight. If you need a regular arithmetic mean where every observation counts equally, use Excel’s AVERAGE function tutorial instead.
Set up the values and weights
Enter one value and its matching weight on each row. This example uses unit price and number of units:
| Row | Unit price (A) | Units (B) | Extended cost |
|---|---|---|---|
| 2 | $5.00 | 50 | $250.00 |
| 3 | $7.00 | 30 | $210.00 |
| 4 | $8.00 | 20 | $160.00 |
| Total | 100 | $620.00 |
Here the weight is units purchased. For a weighted grade, the weight could be credits or assignment percentage. The weight must represent how much influence each value should have.
Calculate the weighted average with SUMPRODUCT
Choose an empty cell and enter:
=SUMPRODUCT(A2:A4,B2:B4)/SUM(B2:B4)
SUMPRODUCT multiplies corresponding cells, then adds those products. In this example, it calculates 5×50 + 7×30 + 8×20, or $620. Dividing by the total weight, 50+30+20 = 100, gives $6.20 per unit.
Microsoft documents this SUMPRODUCT pattern for a weighted average. The value range and weight range must have the same dimensions. See the official SUMPRODUCT function reference for behavior and examples.
Use cell ranges that stay aligned
- Place each value and its weight on the same row.
- Select equal-sized ranges in the formula. Here A2:A4 has three cells, and B2:B4 also has three.
- Keep totals outside the source ranges so the formula does not include its own result or double-count a total row.
- Copy the formula to another result cell only after checking that the ranges still refer to the intended data.
If your dataset grows, convert it to an Excel Table and use structured references so the ranges expand with new rows. For related multi-condition summaries, see how to sum monthly values with SUMIFS.
Check the result and handle common issues
Verify the result two ways: multiply each value by its weight and add those products, then divide by the sum of the weights. A weighted average should fall between the smallest and largest included values when all weights are nonnegative and the total weight is positive. In this example, $6.20 is between $5 and $8.
| What you see | What to check |
|---|---|
#DIV/0! |
The total weight is zero or blank. Enter positive weights and confirm the range includes them. |
| A surprising result | Confirm each value is paired with its own weight on the same row. A shifted weight range changes the answer. |
#VALUE! or an error |
Check for errors in either range and make sure the selected ranges have matching shapes. |
| Numbers stored as text | Convert the values and weights to numeric cells; text entries may not contribute as expected. |
Zero weights contribute nothing, which can be useful for excluded observations. A negative weight usually does not make sense for quantities or credit hours; review the source data instead of accepting the result. Do not include subtotal rows in either range.
Frequently asked questions
What is the weighted-average formula in Excel?
Multiply each value by its corresponding weight, add those products with SUMPRODUCT, and divide by the sum of the weights: =SUMPRODUCT(values,weights)/SUM(weights).
Can I calculate a weighted average with percentages?
Yes. If the percentages add to 100%, use them as weights and divide the weighted sum by their total if they might not total exactly 100%. If they are guaranteed to total 100%, the denominator is 1 (or 100% in Excel’s stored value).
Why does my weighted average equal the ordinary average?
That can happen when all weights are equal. It can also happen by coincidence; compare the individual products and total weights to verify.
Can SUMPRODUCT handle different-sized ranges?
No. Select corresponding ranges with the same dimensions and keep each value aligned with its own weight.

Make your Excel summaries more useful
Browse the OneXcel Tutorial Hub for practical formulas and workflow guides.