📊 StockCalc

How to Calculate Weighted Average

Use weights when every data point should not count equally—grades by credit hours, portfolio cost basis by shares, or any ratio where importance differs.

How to Calculate Weighted Average

Updated May 2026 · ~8 min read

This guide shows you how to use the weighted average calculator effectively: what each input field means, how the formula works behind the scenes, and which common mistakes produce misleading outputs. Every number below is illustrative—plug in your own figures and verify with independent sources.

When you need a weighted average

The formula

See the formula block for weighted average.

Confirm units and period conventions before relying on the output.

Example 1: Average cost per share (portfolio)

Example 1: Average cost per share (portfolio)

You hold three lots of the same stock. You want one number for “what did I pay per share on average?”—weighted by how many shares you own at each purchase price.

  • 100 shares at $180 → weight 100, value 180 → contribution 18,000
  • 50 shares at $400 → weight 50, value 400 → contribution 20,000
  • 200 shares at $140 → weight 200, value 140 → contribution 28,000
  1. Sum of weights: 100 + 50 + 200 = 350 shares.
  2. Sum of (weight × value): 18,000 + 20,000 + 28,000 = 66,000.
  3. Weighted average price: 66,000 ÷ 350 = $188.57 per share (rounded to cents).

Intuition: you own more shares at $140 than at $400, so your average cost is pulled below the middle of the three prices. A simple average of the three prices (($180 + $400 + $140) / 3 ≈ $240) would ignore position sizes and would be wrong for cost basis.

Suppose course grades are on a 4.0 scale and credit hours are the weights.

Course Grade (x) Credits (w) w × x
Economics3.7311.1
Statistics3.3413.2
Finance4.0312.0

Sum of weights = 3 + 4 + 3 = 10 credits. Sum of w×x = 11.1 + 13.2 + 12.0 = 36.3.

Weighted GPA = 36.3 ÷ 10 = 3.63. The four-credit statistics course moved the result more than the three-credit courses—exactly what “weighted” means.

How to use this calculator

  1. Choose your currency and units. Ensure all monetary inputs use the same currency; mixing dollars and euros will produce nonsensical results.
  2. Enter the primary inputs. For weighted average, the key fields are shown above. Use trailing or forward figures consistently—do not mix periods within a single calculation.
  3. Adjust optional parameters. Some calculators allow you to toggle dilution, tax rates, or compounding frequency. Select the option that matches your analytical intent.
  4. Review the output. The result appears instantly. If it looks surprising, recheck each input before assuming the market is wrong.
  5. Compare scenarios. Change one variable at a time to see sensitivity—this is more useful than running isolated single-point calculations.
  6. Export or document. Take a screenshot or copy the inputs into your own spreadsheet so you can reproduce the result later.

Real-world calculation examples

Below are two illustrative scenarios that walk through weighted average step by step. Numbers are fictional and for educational purposes only.

Scenario A — Conservative estimate

  • Primary input: $10,000 initial amount.
  • Rate or factor: 5.0% annual.
  • Time horizon: 10 years.
  • Result: approximately $16,289 (simple projection before taxes and fees).

Scenario B — Aggressive assumption

  • Primary input: $10,000 initial amount.
  • Rate or factor: 10.0% annual.
  • Time horizon: 10 years.
  • Result: approximately $25,937 — note the outsized sensitivity to the rate input.

The gap between Scenario A and Scenario B illustrates why small changes in input assumptions can produce dramatically different outcomes. Always document which scenario most closely matches reality before acting on a calculation.

Common questions from users

Limitations to keep in mind

Weighted Average is a starting point, not a final answer. The calculator assumes static inputs and does not model changing market conditions, transaction costs, or behavioral biases. For major financial decisions, cross-check with a qualified advisor and stress-test your assumptions under multiple scenarios.

Input sensitivity Impact on result
Rate ±1 %Compounds exponentially over long horizons.
Time ±5 yearsLarge effect due to compounding and discounting.
Currency mismatchProduces misleading comparisons across markets.

When computing a weighted average across heterogeneous data sources—for example, blending cost basis from multiple purchase lots or aggregating survey responses with unequal sample sizes—always verify that weights sum to the correct denominator (typically 1.0 or 100%) before trusting the output. A weight that is off by even a few percentage points propagates directly into the final result, and in portfolio contexts this can mean the difference between an accurate cost basis and a misreported capital gain.

Common mistakes

Try the calculator

Use the interactive calculator to plug in your numbers and see results instantly—without redoing the math by hand.

Open weighted average calculator →

FAQ

Weighted average vs weighted median—what’s the difference?

A weighted average uses all values and weights in one formula. A weighted median is a robust alternative when outliers skew the mean; it’s less common in everyday finance homework but appears in advanced statistics.

Can weights be percentages instead of counts?

Yes, as long as they’re on the same scale (e.g. 60%, 30%, 10% should sum to 100%). The formula is the same: Σ(w×x)/Σw. If you use raw percentage points, avoid double-normalizing.

Why is my weighted average lower than every price I paid?

It shouldn’t be, unless you’re mixing in negative weights or liabilities (advanced). Recheck that each weight multiplies its matching value and that you divide by the sum of weights, not the number of rows.

How accurate is the calculator?

It uses standard financial formulas with double-precision arithmetic. Accuracy depends entirely on the quality of your inputs.

Can I embed this on my site?

StockCalc calculators are for personal use. Link to the tool page instead.

Related calculators

Educational Disclaimer

This article is for educational and informational purposes only and should not be considered investment, financial, tax, or legal advice. Market information may change over time, and readers should verify important details independently before making financial decisions.