Weighted Average Calculator: Formula, Steps & Target Value

A coffee roaster buys three lots of beans: 120 kg at $4.20, 300 kg at $3.85 and 80 kg at $5.10. The 500 kg cost $2,067 in total, which is $4.134 per kilo. The plain average of the three prices is $4.38, about 25 cents too high, because it treats the 80 kg lot as if it mattered as much as the 300 kg one. A weighted average gives each value the importance it actually has.

Enter your values and their weights, and the calculator returns the weighted average with every product and sum shown. It also gives what each item adds to the result, the plain average for comparison, the weighted median, the weighted standard deviation and the effective number of items. A second tab works backwards to the value or weight you still need to reach a target, and a third finds the average cost of shares bought at different prices. It opens on the coffee beans.

Weighted Average Calculator

Same order in both boxes. You can also paste two columns (value and weight) into the Values box and leave Weights empty.

Weighted average –
Chart
Step by step

    What Counts as the Weight?

    The formula never changes: multiply each value by its weight, add the products, and divide by the total of the weights.

    Weighted average = Σ(value × weight) ÷ Σ(weight)

    The hard part is choosing the weight. It is whatever says how much of the total each value stands for:

    You’re averagingThe valuesThe weights
    Price paid across several purchasesprice per unitunits bought (kg, litres, shares)
    A score made of weighted partseach part’s scoreeach part’s percentage
    Averages from groups of different sizeeach group’s averagenumber of people or items in the group
    Rates or percentages from groupseach group’s ratethe size the rate is measured on (visits, units made)
    Speed over several stretcheseach stretch’s speedtime spent on the stretch
    Return on a portfolioeach holding’s returnamount invested in it
    Outcomes of a chance eventeach outcomeits probability

    The speed row catches people out, and it has its own section below. The last row makes the weighted average an expected value, which the expected value calculator handles with variance and repeated plays.

    Coffee Beans by the Kilo, Worked Through

    LotPrice per kgKilos (weight)Price × kilosAdds to the average
    1$4.20120$504.00$1.008
    2$3.85300$1,155.00$2.310
    3$5.1080$408.00$0.816
    Total500$2,067.00$4.134

    Dividing $2,067 by 500 kg gives $4.134. The last column splits that answer into the part each lot supplies: price × its share of the kilos. Lot 2 supplies more than half of it because it is 60% of the beans. That’s why the weighted average sits much nearer $3.85 than $5.10, and $0.25 below the plain average of $4.3833.

    Two checks catch mistakes. The weighted average must lie between the smallest and largest value ($3.85 and $5.10 here). And when one item holds most of the weight, the result should land near that item’s value; if it doesn’t, a value and a weight have probably been paired wrongly.

    Weights That Don’t Add Up to 100

    Percentage weights should total 100%, but sometimes they stop short. A buyer scores a supplier on price (40%), quality (35%) and delivery (15%), forgetting a 10% service score. The supplier gets 7, 9 and 6 out of 10.

    • Dividing by 100: (7 × 40 + 9 × 35 + 6 × 15) ÷ 100 = 685 ÷ 100 = 6.85
    • Dividing by the weights actually used: 685 ÷ 90 = 7.6111

    The first treats the missing 10% as a score of zero. The second treats the three listed parts as the whole. Once the service score of 8 is added, the true result is 765 ÷ 100 = 7.65, close to the second answer but not equal to it.

    The calculator always divides by the real total of the weights, and when the weights are marked as percentages but don’t add to 100, it says so. If part of the weight is still to come, the Value needed tab is the right tool. Weights don’t have to be percentages at all: kilos, credits, counts and dollars work as they are, since only their proportions matter. Doubling every weight changes nothing.

    Averaging Averages: When Groups Differ in Size

    A shop has two branches. Branch A averages $42 a sale over 600 sales; branch B averages $65 over 150 sales. The average sale across both is not (42 + 65) ÷ 2 = $53.50. Weighted by the number of sales it is (42 × 600 + 65 × 150) ÷ 750 = $46.60, because four out of five sales happen in branch A.

    Rates behave the same way. A website converts 2% of 10,000 visits on one page and 8% of 500 visits on another. Averaging the two rates gives 5%. The real rate is (200 + 40) ÷ 10,500 = 2.29%. Weighting by visits is the same as adding the conversions and dividing by the total visits, which is the safest way to think about it: go back to the counts whenever you can.

    Unequal group sizes can even reverse a comparison. In a 1986 study of kidney-stone treatments (Charig and colleagues, a standard example of Simpson’s paradox), treatment A worked better for small stones (81 of 87, 93% vs 234 of 270, 87%) and for large stones (192 of 263, 73% vs 55 of 80, 69%). Overall, B looked better: 289 of 350 (83%) against 273 of 350 (78%). A was mostly used on the harder large stones, so its overall rate is weighted toward them.

    When the groups are the same size, the plain average and the weighted one agree. The gap grows as the sizes become more unequal. The mean, median and mode calculator is the right tool when every value counts once.

    Average Speed Is Not the Average of the Speeds

    Drive 60 km at 30 km/h and come back the same 60 km at 90 km/h. The average speed is not 60 km/h. The trip takes 2 hours out and 40 minutes back, so 120 km in 2⅔ hours is 45 km/h.

    The mistake was weighting the two speeds equally. Speed must be weighted by time: (30 × 2 + 90 × ⅔) ÷ 2⅔ = 45. Weighting by distance (60 km each) gives the wrong 60. If you only know the distances, the right result is total distance divided by total time. The same rule applies to fuel economy: two equal-length legs at 20 and 40 miles per gallon average 26.67 mpg over the trip, not 30.

    What Value Do You Still Need?

    The Value needed tab answers two backward questions.

    What value does the next item need? Back at the roaster, the average is $4.134 per kilo for 500 kg. The next lot will be 200 kg. To bring the average down to $4.00, the new lot must cost:

    (4.00 × 700 − 2,067) ÷ 200 = $3.665 per kg

    How much weight does a given value need? A café has a 4.3-star rating from 120 reviews and wants 4.5. Every new review is 5 stars at best. The number of 5-star reviews needed is:

    (4.3 × 120 − 4.5 × 120) ÷ (4.5 − 5) = 48 reviews in a row

    Both formulas come from setting the new weighted average equal to the target and solving. When the target equals the new value, no amount of weight is enough: 5-star reviews can push the rating toward 5 but never to it, and the calculator says so. When the new value lies on the wrong side of the target, it reports that adding it moves the average away.

    Average Cost of Shares, and Averaging Down

    Repeated purchases at different prices are a weighted average with prices as values and quantities as weights. Type one purchase per line in the Share average cost tab:

    PurchaseSharesPriceCost
    110$52.40$524.00
    215$47.10$706.50
    325$44.00$1,100.00
    Total50$2,330.50

    The average cost is $2,330.50 ÷ 50 = $46.61 per share. The simple average of the three prices, $47.83, is wrong for the same reason as the coffee example.

    With the price now at $38.50, the holding shows a paper loss of $405.50. Buying 20 more at $38.50 lowers the average to $44.29. Reaching an average of $42 would take 65.86 shares, so 66 whole shares costing $2,541.

    Lowering the average does not shrink the loss. After the extra 20 shares, 70 shares × ($38.50 − $44.2929) is still −$405.50, because the new shares were bought at today’s price. What changes is the break-even price and the amount of money at stake. Whether to buy more is a separate question about the company, not about the average. The calculator leaves out fees and taxes, and the rules for cost basis differ between countries and account types. This is arithmetic, not financial advice.

    Inventory: The Average Cost After Sales and New Stock

    Shops and warehouses that use the weighted average cost method keep a running average of this kind. Selling stock doesn’t change the average, only the quantity; buying stock at a new price does.

    The roaster starts with 500 kg at $4.134. It sells 200 kg, so 300 kg remain, still at $4.134 per kg. Then the 200 kg lot arrives at $3.665. The new average is (300 × 4.134 + 200 × 3.665) ÷ 500 = $1,973.20 ÷ 500 = $3.9464 per kg. Each sale is costed at the average in force when it happens, so the same bag of beans can carry a different cost before and after a delivery.

    Type the stock on hand and the new delivery as two lines in the Share average cost tab (300 @ 4.134 and 200 @ 3.665). It works for any repeated purchase, not just shares.

    The Cost of Capital Is a Weighted Average Too

    A company’s weighted average cost of capital (WACC) weights what each source of money costs by its share of the total. Suppose a firm is funded by $600,000 of equity that investors expect to earn 10% on and $400,000 of debt at 8% interest, with a 25% tax rate. Interest is tax-deductible, so the debt really costs 8% × (1 − 0.25) = 6%.

    WACC = 0.6 × 10% + 0.4 × 6% = 8.4%

    The weights are the shares of the capital (60% and 40%), not the timing of any cash flows. A project that earns less than 8.4% on average doesn’t cover what its funding costs.

    Spread Around a Weighted Average

    An average says nothing about how far the values sit from it. Three extra numbers help:

    • Weighted standard deviation. For the coffee beans, √(Σw(x − 4.134)² ÷ Σw) = $0.4458. With weights that are counts of identical items (choose “Counts” in the menu), the calculator also gives the sample version, dividing by Σw − 1, which matches the ordinary standard deviation of the full list.
    • Weighted median. The value where half the weight lies on each side: $3.85 for the beans, since that one lot holds 60% of the kilos.
    • Effective number of items. (Σw)² ÷ Σw² = 500² ÷ 110,800 = 2.26. Three lots with uneven weights act like 2.26 equal ones. In survey work this is Kish’s effective sample size: a survey whose weights are very uneven carries less information than its raw count suggests.

    Weighted Averages in Excel and Google Sheets

    With values in A2:A4 and weights in B2:B4:

    ToolFormulaBeans result
    Excel or Sheets=SUMPRODUCT(A2:A4, B2:B4) / SUM(B2:B4)4.134
    Google Sheets only=AVERAGE.WEIGHTED(A2:A4, B2:B4)4.134

    Two slips are worth watching for. Dividing by 100 instead of SUM(B2:B4) gives the wrong answer whenever the weights don’t total exactly 100. And ranges of different lengths make SUMPRODUCT return an error, which is the spreadsheet’s way of saying a value lost its weight.

    Four Problems to Try, With Answers

    1. A nut mix uses 3 kg of almonds at $12/kg and 2 kg of cashews at $18/kg. What does the mix cost per kilo? Answer: (3 × 12 + 2 × 18) ÷ 5 = $14.40/kg.
    2. A portfolio holds $6,000 that returned 8%, $3,000 that returned −2% and $1,000 that returned 15%. What was the overall return? Answer: (6,000 × 8 + 3,000 × (−2) + 1,000 × 15) ÷ 10,000 = 5.7%.
    3. Two shifts make 240 units with 2.5% defective and 160 units with 4% defective. What is the defect rate for the day? Answer: (240 × 2.5 + 160 × 4) ÷ 400 = 3.1%, not the 3.25% that averaging the rates gives.
    4. A 300 km trip covers its first half at 100 km/h and its second half at 60 km/h. What is the average speed? Answer: 150 km takes 1.5 h, then 150 km takes 2.5 h, so 300 ÷ 4 = 75 km/h, not 80.

    For grades split into categories such as homework, quizzes and exams, the weighted grade calculator works out the grade so far and the score needed on the remaining work.