Weighted Average in Excel and Google Sheets (SUMPRODUCT)
A normal average treats every number the same. A weighted average gives some numbers more influence: an exam worth 50% of a grade, or a price paid on 300 units versus 80. Excel has no single weighted average function, but SUMPRODUCT and SUM do it in one line.
The weighted average formula
=SUMPRODUCT(values, weights)/SUM(weights)
SUMPRODUCT multiplies each value by its weight and adds the results. Dividing by the total of the weights turns that into an average. The formula works the same in Excel and Google Sheets.
Example 1: weighted grade
| A: Score | B: Weight | |
|---|---|---|
| Row 2 | 88 | 20% |
| Row 3 | 92 | 30% |
| Row 4 | 79 | 50% |
=SUMPRODUCT(A2:A4,B2:B4)/SUM(B2:B4)
Result: 84.7 (88 x 0.2 + 92 x 0.3 + 79 x 0.5 = 17.6 + 27.6 + 39.5). A plain =AVERAGE(A2:A4) would say 86.33, which overstates the grade because the lowest score carries the most weight.
Example 2: average price weighted by quantity
| A: Product | B: Unit price | C: Quantity | D: Region | |
|---|---|---|---|---|
| Row 2 | Widget | 4.50 | 120 | North |
| Row 3 | Widget | 4.20 | 300 | South |
| Row 4 | Gadget | 9.00 | 50 | North |
| Row 5 | Widget | 4.80 | 80 | North |
=SUMPRODUCT(B2:B5,C2:C5)/SUM(C2:C5)
Result: 4.789, the true average cost per unit across all 550 units. The simple average of the four prices is 5.625, because it gives the 50 Gadgets as much say as the 300 Widgets.
Weighted average with a condition
To average only Widgets, put a test inside SUMPRODUCT and divide by SUMIFS:
=SUMPRODUCT((A2:A5="Widget")*B2:B5*C2:C5)/SUMIFS(C2:C5,A2:A5,"Widget")
Result: 4.368. For two conditions, multiply both tests:
=SUMPRODUCT((A2:A5="Widget")*(D2:D5="North")*B2:B5*C2:C5)/SUMIFS(C2:C5,A2:A5,"Widget",D2:D5,"North")
Result: 4.62 (Widgets sold in the North). More on conditional sums: SUMIFS and COUNTIFS examples.
When the weights do not add up to 100%
Weights can be any numbers: credit hours, units sold, hours worked. Because the formula divides by SUM(weights), they are scaled automatically. A GPA example with grade points 3.7, 3.0 and 4.0 for courses of 4, 3 and 1 credits:
=ROUND(SUMPRODUCT(A2:A4,B2:B4)/SUM(B2:B4),2)
Result: 3.48 (27.8 grade points / 8 credits = 3.475, rounded). See how to round numbers.
Google Sheets: AVERAGE.WEIGHTED
Google Sheets has a dedicated function:
=AVERAGE.WEIGHTED(A2:A4,B2:B4)
It gives the same 84.7. Excel does not have AVERAGE.WEIGHTED, so use SUMPRODUCT if the file will be opened in Excel.
Common errors
- #VALUE!: the value and weight ranges are different sizes (A2:A4 with B2:B5). SUMPRODUCT needs ranges of the same shape
- #DIV/0!: every weight is blank or zero, or no rows match your condition. Wrap it: =IFERROR(formula,"")
- Wrong answer, no error: weights typed as text (for example '20%' imported from another system). Convert them to numbers first
- Blank cells count as zero in SUMPRODUCT, so a missing weight quietly drops that row
Weighted average in a pivot table
Pivot tables cannot weight an average on their own. Add a helper column (price x quantity), sum it in the pivot, sum the quantity too, and divide the two totals. Our pivot table guide for beginners shows the basics.
Quick FAQ
What is the formula for a weighted average in Excel? =SUMPRODUCT(values, weights)/SUM(weights), for example =SUMPRODUCT(A2:A4,B2:B4)/SUM(B2:B4).
Do the weights have to add up to 100%? No. Dividing by SUM(weights) scales them, so credits, quantities or hours all work.
How do I do a weighted average with criteria in Excel? Multiply by the condition inside SUMPRODUCT and divide by SUMIFS on the weights: =SUMPRODUCT((A2:A5="Widget")*B2:B5*C2:C5)/SUMIFS(C2:C5,A2:A5,"Widget").
Can I calculate a weighted average without SUMPRODUCT? Yes. Add a helper column with value x weight, then divide its SUM by the SUM of the weights. In Google Sheets you can also use AVERAGE.WEIGHTED.
Why is my weighted average different from AVERAGE? AVERAGE gives every row equal weight. A weighted average lets the larger weights pull the result towards their values, so the two only match when all weights are equal.
Sources: Microsoft: SUMPRODUCT function; Google Docs Editors Help: AVERAGE.WEIGHTED function. Formulas tested in LibreOffice 25.2 on 1 December 2026.
Prefer a ready-made file?
- Excel & Google Sheets Formula Cheat Sheet (50 tested formulas + practice workbook) (US$4, Payhip): 50 formulas for lookups, SUMIFS, IF, text, dates, percentages and FILTER/UNIQUE, each shown with its result, plus an error-fix page and a practice workbook.
Related: Percentage change formula in Excel