SuperDevTools

Weighted average calculator

Use case

    Tip: copy two columns from a spreadsheet and paste them into the first value box. The rows fill downwards.

    Paste two columns from a spreadsheet

    Weighted average —

    Sum of weights
    —
    Sum of products (value × weight)
    —
    Simple average, ignoring weights
    —
    Rows counted
    —
    Advanced: weighted geometric and harmonic means
    Weighted geometric mean
    —
    Weighted harmonic mean
    —

    • Geometric: for changes that compound. A 10% rise followed by a 10% fall is entered as 1.1 and 0.9; the result is the average growth factor per period.
    • Harmonic: for ratios weighted by their numerator, such as speeds weighted by distance or unit prices weighted by the money spent.

    Working

    —

    Your rows are saved on this device, in this browser.

    A mean where each value counts by its weight

    This weighted average calculator works from pairs of values and weights. Use it when the values do not all matter equally: shares bought in several lots, stock received in several deliveries, savings of different sizes earning different rates, survey answers weighted by age group. Next to the weighted mean you get the sum of weights, the sum of products, the simple average for comparison and each row's share of the result.

    How to use it

    1. Pick a "Use case" ("Average purchase price", "Weighted average cost", "Average rate"…): it loads an example and renames the columns. "Values and weights" starts from empty rows.
    2. Under "Weights entered as", keep "Numbers" for quantities or amounts, or switch to "Percentages".
    3. Type each value and its weight; "Add a row" adds another. An empty weight counts as 1.
    4. From a spreadsheet, copy two columns and paste them into the first value box: the rows fill downwards.
    5. Read the "Weighted average" and the "Working" underneath.

    The formula and three examples you can check

    The weighted mean is x̄ = Σ(xᵢ × wᵢ) ÷ Σwᵢ: multiply each value by its weight, add up the products and divide by the total of the weights.

    • Average purchase price. 100 shares at $10, then 50 at $13: (100 × 10 + 50 × 13) ÷ 150 = 1,650 ÷ 150 = $11. A plain average of the two prices would say $11.50 and overstate your cost basis.
    • Weighted grade. 12 with weight 2, 15 with weight 3 and 8 with weight 1: (24 + 45 + 8) ÷ 6 = 77 ÷ 6 ≈ 12.83, against 11.67 without weights.
    • Weighted average cost of inventory. 200 units on hand at $4.50, then 300 received at $5: 2,400 ÷ 500 = $4.80 per unit, the cost you then charge to each unit sold.

    For an average interest rate, the weight is the balance: $10,000 at 3% and $5,000 at 1.5% give 375 ÷ 15,000 = 2.5%.

    Percentage weights should add up to 100%

    A portfolio with 50% in a fund that returned 8%, 30% in one that returned 2% and 20% in one that lost 1% returned 0.5 × 8 + 0.3 × 2 + 0.2 × (−1) = 4.4%. If your percentages add up to 110%, the tool tells you. The result is still right, because it divides by the actual total; "Scale to 100%" rewrites the weights so they do.

    Geometric or harmonic mean: when to use them

    The advanced option also gives these two weighted means. The harmonic mean is for ratios such as speed. Driving out at 60 mph and back at 40 mph over the same distance is not 50 mph on average: for 30 miles each way, the trip out takes 30 minutes and the trip back 45, so 60 miles in 1.25 hours, which is 48 mph. The geometric mean is for changes that compound: +10% then −10% are entered as 1.1 and 0.9.

    Frequently asked questions

    How is this different from a simple average?

    A simple average gives every value the same say. It is a weighted average where every weight is 1.

    Do the weights have to add up to 100?

    No. Quantities, dollar amounts or credits all work, because dividing by the sum of weights rescales everything. Only the percentage mode checks for 100%.

    What does "Share of result" mean?

    The row's value × weight divided by the sum of products. In the share example, the first lot makes up 60.6% of the result.

    Are my rows sent anywhere?

    No. The maths runs in your browser, and your rows stay on this device until you press "Clear all".