Weighted Average Price with SUMPRODUCT

Excel Formulas › Statistics

All versions

A plain AVERAGE treats a 1-unit buy and a 1,000-unit buy equally. A weighted average uses quantity as the weight, giving the true blended price.


Quick formula: Multiply price by quantity, sum, and divide by total quantity:
=SUMPRODUCT(Prices,Quantities)/SUM(Quantities)

SUMPRODUCT does the row-by-row multiply-and-add in one step.

Functions used (tap for the full reference guide):

The example

Three purchases at different prices and quantities. We want the true average cost per unit.

ABC
1LotPriceQty
2A$10100
3B$12300
4C$15100
5Weighted avg$12.20

The formula

SUMPRODUCT multiplies each price by its quantity and adds the results; dividing by total quantity gives the blended price:

=SUMPRODUCT(B2:B4,C2:C4)/SUM(C2:C4) // total dollars ÷ total units = weighted average

How it works

Why it differs from a plain average:

  1. SUMPRODUCT computes 10×100 + 12×300 + 15×100 = 1,000 + 3,600 + 1,500 = $6,100 spent.
  2. SUM of quantities is 100 + 300 + 100 = 500 units bought.
  3. Divide: $6,100 ÷ 500 = $12.20 per unit — the true blended cost.
  4. A plain AVERAGE of $10, $12, $15 would give $12.33, ignoring that lot B was three times the size.

This is exactly how weighted-average inventory costing works, and how a blended interest or grade average is computed.

Try it: interactive demo

Interactive

Enter three prices and quantities; see the weighted average versus a plain average.

Variations

Weighted average grade

Same formula with scores and credit weights.

=SUMPRODUCT(Scores,Weights)/SUM(Weights)

Ignore blank or zero quantities

SUMPRODUCT naturally skips zero-weight rows since they contribute nothing.

=SUMPRODUCT(B2:B4,C2:C4)/SUM(C2:C4)

Pitfalls & errors

The two ranges must be the same length. Mismatched sizes make SUMPRODUCT return #VALUE!.

Do not use a plain AVERAGE when the items have different weights — it can be materially wrong, as the $12.33 vs $12.20 gap shows.

Practice workbook

📊
Download the free Weighted Average Price with SUMPRODUCT practice workbook
Edit the yellow prices and quantities; the weighted average recalculates.

Frequently asked questions

When should I weight an average?
Whenever the items differ in size or importance — purchase lots, portfolio holdings, course credits. Equal items can use a plain AVERAGE.
What does SUMPRODUCT actually do?
It multiplies the two ranges element by element and sums the products — exactly the total-dollars step of a weighted average.
Can I weight by something other than quantity?
Yes — any weight column works: dollars, credits, hours, or population. Just divide by the sum of those weights.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Weighted average grade

Function references: SUMPRODUCTSUM