Weighted Average in Numbers: Use SUMPRODUCT and SUM
The examples use this table.
| A | B | C | |
|---|---|---|---|
| 1 | Product | Price | Qty |
| 2 | Apple | 4 | 10 |
| 3 | Pear | 6 | 5 |
| 4 | Kiwi | 12 | 2 |
| 5 | Grape | 8 | 3 |
Why a plain average is not always right
AVERAGE counts every value equally. If some values should count for more, such as a price that applies to a larger quantity, you need a weighted average. Here is the plain average of the prices for comparison.
=AVERAGE(B2:B5)Result: 7.5
Step 1: multiply each value by its weight
SUMPRODUCT multiplies two ranges row by row and adds up the results. Price times quantity for each product, added together, gives the total value.
=SUMPRODUCT(B2:B5,C2:C5)Result: 118
Step 2: divide by the total weight
Divide that total by the sum of the weights. The result is the average price per unit, taking quantities into account. It is lower than the plain average because the cheaper products were bought in larger numbers.
=SUMPRODUCT(B2:B5,C2:C5)/SUM(C2:C5)Result: 5.9
A typical use: grades with weights
The same formula works for grades that count for different percentages. Put the grades in one column and the weights in another, then divide SUMPRODUCT by the total of the weights.
=SUMPRODUCT(B2:B5,C2:C5)/SUM(C2:C5)Frequently asked questions
What is a weighted average?
An average where some values count more than others. Each value is multiplied by its weight, the results are added up and divided by the total weight.
Is there a WEIGHTED AVERAGE function in Numbers?
No. You combine SUMPRODUCT and SUM, as shown in this article.
Do the two ranges have to be the same size?
Yes. SUMPRODUCT needs a weight for each value, so both ranges must have the same number of cells.
Functions in this article
Practise it yourself
Type the formula yourself in a real exercise and see right away if your answer is correct. The first exercises are free.
Start practising