Free Stock Tool

Weighted Stock Average Calculator

Calculate your weighted average cost per share across multiple stock purchases. Track your total investment, unrealized profit or loss, break-even price, and cost basis — instantly and for free.

Quick Formula
Avg Cost = Σ (Price × Shares) ÷ Σ Shares
#PurchasePrice/Share ($)SharesSubtotal
1$15,000
2$19,500
3$7,250

Optional Inputs

Current Market Price

Brokerage & Transaction Fees

Currency Selection (Optional)

Advanced Calculator Options

Your Portfolio Results

Average Cost Per Share

$138.33

Total Shares Owned

300

Total Investment Amount

$41,500.00

Current Portfolio Value

$46,500.00

Unrealized Profit or Loss

+$5,000.00 (+12.05%)

Break-Even Price

$138.33

Required Price Change (%)

Purchase Breakdown Analysis

Contribution of Each Purchase

Investment Allocation Summary

Cost Basis Breakdown

Portfolio Cost Trend (Interactive Visual)

Average Cost After Each Purchase

Market Price vs Average Cost

What Is a Weighted Stock Average?

Definition

A weighted stock average (also called weighted average cost or cost basis) is the average price you paid per share across multiple purchases, where each purchase price is weighted by the number of shares bought. It reflects your true cost-per-share more accurately than a simple average of purchase prices.

Why Average Cost Matters

Your average cost determines your break-even price — the minimum price the stock must reach for you to break even. It’s also essential for calculating capital gains taxes when you sell. Without knowing your true average cost, you can’t accurately assess your investment performance or tax liability.

Understanding Stock Cost Basis

Cost basis is the total amount you paid for your shares, including brokerage fees. The IRS uses cost basis to calculate your capital gains or losses when you sell. If you bought 100 shares at $50 ($5,000) and 50 shares at $60 ($3,000), your total cost basis is $8,000 and your average cost per share is $53.33.

Weighted Average vs Simple Average

A simple average: ($50 + $60) ÷ 2 = $55.00. The weighted average: (100×$50 + 50×$60) ÷ 150 = $53.33. The weighted average is $1.67 lower because you bought more shares at the cheaper price. Weighted average always reflects reality; simple average does not.

How to Calculate Weighted Stock Average

Weighted Stock Average Formula

Formula

Avg Cost=
Σ (Pricei × Sharesi)
Σ Sharesi

Formula Variables

PriceiPurchase price per share for each buy order
SharesiNumber of shares bought in each purchase
ΣSum across all purchases
Avg CostYour weighted average cost per share

How the Formula Works

The formula multiplies each purchase price by how many shares you bought at that price, sums all the costs, and divides by total shares. This weights each price by the quantity purchased, giving larger purchases more influence on your average cost.

Step-by-Step Calculation

1. Multiply each purchase price by shares bought
2. Add all subtotals together (= Total Cost)
3. Add all shares together (= Total Shares)
4. Divide Total Cost by Total Shares (= Average Cost)

Manual Calculation Method

Purchase 1: 100 shares × $150.00 = $15,000
Purchase 2: 150 shares × $130.00 = $19,500
Purchase 3: 50 shares × $145.00 = $7,250
Total Cost: $15,000 + $19,500 + $7,250 = $41,750
Total Shares: 100 + 150 + 50 = 300
Average Cost Per Share: $41,750 ÷ 300 = $139.17

Weighted Stock Average Examples

Example: Two Stock Purchases

Buy 100 shares @ $50 = $5,000
Buy 200 shares @ $45 = $9,000
Average: $14,000 ÷ 300 = $46.67
Simple avg would be $47.50 — overstates by $0.83

Example: Three Stock Purchases

Buy 50 shares @ $100 = $5,000
Buy 75 shares @ $90 = $6,750
Buy 25 shares @ $110 = $2,750
Average: $14,500 ÷ 150 = $96.67

Example: Averaging Down

Buy 100 shares @ $80 = $8,000
Stock drops to $60
Buy 100 more @ $60 = $6,000
New Average: $14,000 ÷ 200 = $70.00
Break-even dropped from $80 to $70 — 12.5% lower

Example: Averaging Up

Buy 100 shares @ $50 = $5,000
Stock rises to $65
Buy 50 more @ $65 = $3,250
New Average: $8,250 ÷ 150 = $55.00
Average rose from $50 to $55, but stock is at $65 — still profitable

Example: Multiple Purchases (DCA)

Month 1: 20 shares @ $120 = $2,400
Month 2: 20 shares @ $115 = $2,300
Month 3: 20 shares @ $105 = $2,100
Month 4: 20 shares @ $110 = $2,200
Month 5: 20 shares @ $125 = $2,500
Average: $11,500 ÷ 100 = $115.00
DCA smoothed out the volatility — lowest price was $105, highest $125

How to Use This Calculator

1

Step 1: Enter Buy Prices

Enter the price per share for each stock purchase. Use the actual price you paid at the time of each buy order — check your brokerage trade confirmations for exact prices.

2

Step 2: Enter Share Quantities

Enter the number of shares you bought in each purchase. Fractional shares are supported if your broker allows them.

3

Step 3: Add Additional Purchases

Click “Add Purchase” for each additional buy order. There’s no limit — add as many purchases as you need. Use the preset buttons for quick scenarios.

4

Step 4: Include Optional Fees

Enter brokerage commissions and transaction fees for a more accurate cost basis. These fees increase your true average cost per share.

5

Step 5: Review Your Results

See your weighted average cost, total investment, unrealized P/L (if you entered market price), break-even price, and visual breakdowns of your purchase history.

Portfolio Impact Simulator

How Buying More Shares Changes Your Average

See the effect of adding more shares at a given price on your average cost and break-even.

Effect of Larger vs Smaller Purchases

Current Avg Cost
$138.33
New Avg Cost
$133.75
Avg Cost Change-$4.58
New Total Shares400
Additional Cost$12,000

Impact on Break-Even Price

New Break-Even$133.75

Benefits of Using a Weighted Stock Average Calculator

Track Your True Cost Basis

Know exactly what you paid per share across all purchases. This is critical for tax reporting, performance evaluation, and making informed buy/sell decisions.

Improve Investment Decisions

Compare your average cost to the current market price to see if you’re in profit or loss. This context helps you decide whether to buy more, hold, or sell.

Support Dollar-Cost Averaging (DCA)

Track how your regular purchases at different prices smooth out volatility over time. DCA is one of the most effective long-term investing strategies, and this calculator tracks its impact.

Monitor Break-Even Price

Your break-even price is the minimum the stock needs to reach for you to recover your investment. This calculator shows it instantly and updates as you add purchases.

Plan Future Stock Purchases

Use the Portfolio Impact Simulator to see how buying additional shares at different prices would change your average cost. This helps you plan DCA contributions, decide whether to average down on a dip, or evaluate the impact of adding to a winning position.

Averaging Down vs Averaging Up

What Is Averaging Down?

Averaging down means buying more shares when the price drops below your average cost. This lowers your average cost per share, reducing the break-even price. It’s a strategy that works if the stock recovers, but amplifies losses if it continues declining.

Benefits

Lowers your average cost per share, reduces break-even price, and increases potential profit if the stock recovers. Works well for fundamentally strong companies experiencing temporary dips.

Risks

If the stock continues to fall, you increase your total loss. Never average down blindly — only on stocks with strong fundamentals and a clear thesis for recovery. Set a maximum position size to limit risk.

What Is Averaging Up?

Averaging up means buying more shares as the price rises above your original purchase. This increases your average cost but allows you to build a larger position in a winning investment.

Benefits

Adds to winning positions, captures momentum, and aligns with trend-following strategies. You’re investing in proven winners rather than catching falling knives.

When It Makes Sense

Averaging up works when a stock is in a confirmed uptrend with strong fundamentals, earnings growth, or institutional support. Many legendary investors like William O’Neil advocate buying more as stocks prove themselves.

Selling Shares and Cost Basis

Does Selling Shares Change Your Average Cost?

Under the weighted average method, selling shares does NOT change your per-share average cost. You simply have fewer shares at the same average cost. Under FIFO (First In, First Out), selling removes the earliest-purchased shares first, which can change the remaining cost basis.

Partial Sell Example

You own 300 shares at $138.33 average. You sell 100 shares at $155. Your remaining 200 shares still have a $138.33 average cost. Your realized gain is (155 - 138.33) × 100 = $1,667. The remaining 200 shares have unrealized gain based on current market price.

FIFO vs Weighted Average Method

FIFO sells oldest shares first, which may have a different cost than your average. If your first purchase was at $150 and second at $130, FIFO sells the $150 shares first — resulting in a smaller gain (or larger loss) than the weighted average method. The weighted average method uses the same average cost for all shares regardless of purchase order. Check with your broker which method they use for tax reporting.

Excel Formula for Weighted Stock Average

Excel Formula

Use SUMPRODUCT to calculate the weighted average in Excel:

=SUMPRODUCT(A2:A10, B2:B10) / SUM(B2:B10)

Where column A contains purchase prices and column B contains share quantities.

Google Sheets Formula

Google Sheets uses the same SUMPRODUCT function:

=SUMPRODUCT(A2:A10, B2:B10) / SUM(B2:B10)

Works identically to Excel. You can also use the named range approach for cleaner formulas.

Using SUMPRODUCT for Stock Average

SUMPRODUCT multiplies each price by its corresponding share count, sums all products, then you divide by total shares. Example: Prices in A2:A4 are $50, $45, $60. Shares in B2:B4 are 100, 200, 50. SUMPRODUCT = (50×100 + 45×200 + 60×50) = $17,000. SUM(B2:B4) = 350. Average = $17,000 ÷ 350 = $48.57.

Common Mistakes to Avoid

Using a Simple Average Instead of a Weighted Average

A simple average of $50 and $100 gives $75, but if you bought 100 shares at $50 and only 10 at $100, your true average is $54.55. Always weight by share quantity.

Ignoring Share Quantities

The number of shares bought at each price is critical. Buying 1,000 shares at $10 dominates your average far more than buying 10 shares at $100. Quantity is the “weight” in weighted average.

Forgetting Brokerage Fees

Brokerage commissions and transaction fees increase your true cost basis. A $10 commission on a 100-share purchase adds $0.10 per share to your average cost. Include fees for accurate tax reporting.

Entering Incorrect Purchase Data

Using estimated prices instead of actual trade prices leads to inaccurate averages. Always check your brokerage trade confirmations for the exact fill price and quantity.

Ignoring Market Price Comparison

Knowing your average cost without comparing to the current market price is incomplete. Always enter the current price to see unrealized P/L and break-even status.

Stock Investing Tips

Diversify Your Portfolio

Don’t put all your money in one stock. Spread across sectors, asset classes, and geographies to reduce risk. Use this calculator for each position to track individual cost bases.

Avoid Emotional Investing

Don’t panic-sell during dips or FOMO-buy at peaks. Use your weighted average cost as an anchor — if the stock is above your average, you’re profitable. Stick to your strategy.

Review Your Cost Basis Regularly

Recalculate after each purchase. Your cost basis changes with every new buy order. Regular tracking helps you make informed decisions about adding to or reducing positions.

Follow a Dollar-Cost Averaging Strategy

Invest a fixed amount at regular intervals regardless of price. DCA removes the pressure of timing the market and naturally builds a favorable weighted average over time.

Practice Proper Risk Management

Set position size limits (e.g., no single stock exceeds 10% of portfolio). Use stop-loss orders if appropriate. Know your maximum acceptable loss before entering any position. Your weighted average cost helps you calculate exactly where you stand and how much risk you’re carrying.

Who Should Use This Calculator?

Beginner Investors

New to investing? Track your cost basis from day one. Understanding your average cost per share is fundamental to evaluating investment performance.

Long-Term Investors

Buy-and-hold investors who accumulate shares over months or years need to track their evolving average cost as they add to positions during DCA.

Swing Traders

Traders who scale into positions over multiple entries need precise cost tracking to set profitable exit targets and manage risk-reward ratios.

ETF Investors

ETF investors making regular contributions need to track their weighted average NAV per share across multiple purchases at different prices.

Mutual Fund Investors

Track your cost basis across multiple mutual fund purchases, especially for tax lot management and capital gains reporting.

Dividend Investors

Track cost basis for dividend reinvestment (DRIP) shares purchased at different prices. Each reinvestment creates a new tax lot that affects your average cost.

Investment Dashboard (Interactive Visual)

Portfolio Allocation Overview

Profit vs Loss Snapshot

Break-Even Progress Indicator

Frequently Asked Questions

A weighted stock average calculator computes your average cost per share across multiple purchases by weighting each price by the number of shares bought. It gives you a single cost basis that accurately reflects what you paid per share.

Multiply each purchase price by the number of shares, sum all products, then divide by total shares. Example: (100×$50 + 200×$45) ÷ 300 = $46.67.

Weighted Average Price = Σ(Price_i × Shares_i) ÷ Σ(Shares_i). Each price is weighted by the number of shares purchased at that price.

Simple average treats each price equally. Weighted average accounts for how many shares you bought at each price. If you bought 100 shares at $50 and 10 at $100, simple avg is $75 but weighted avg is $54.55.

Averaging down (buying more when price drops) lowers your average cost, reducing the break-even price. Buying 100 shares at $50 then 100 at $40 gives $45 average instead of $50.

Averaging up (buying more as price rises) increases your average cost but builds a larger position in a winner. Your average stays between your lowest and highest purchase prices.

Cost basis is the total amount paid for your shares including fees. It's used by the IRS to calculate capital gains/losses. A lower cost basis means higher profit when selling.

Yes. Enter each purchase with its price and quantity. The calculator handles unlimited purchases and computes the weighted average across all of them.

Yes, for accurate tax reporting. The IRS requires including commissions and fees in your cost basis. Use the fees field to include them in your calculation.

Yes. Enter the current market price to see unrealized P/L in both dollar amount and percentage.

Under the weighted average method, selling does NOT change your average cost per share. Under FIFO, it can, because the earliest (potentially different-priced) shares are removed first.

Yes. ETFs and mutual funds work the same way. Enter price per share/unit and quantity for each purchase.

Yes. Enter each crypto purchase price and quantity. Works for Bitcoin, Ethereum, or any cryptocurrency.

Use: =SUMPRODUCT(PriceRange, SharesRange) / SUM(SharesRange). For example: =SUMPRODUCT(A2:A5, B2:B5) / SUM(B2:B5).

Yes, 100% free. No registration needed. All calculations happen in your browser — no data stored or sent anywhere.

Explore Our Calculator Tools

Specialized purpose-built weighted average calculators — each tailored to a specific domain with unique inputs, outputs, and interactive visualizations.

Weighted Percentage Calculator
Calculate weighted percentages with auto weight normalization, contribution breakdown, and percentage vs numeric weight modes.
Weighted % Normalization Contributions
Weighted Mean Calculator
Calculate weighted arithmetic means with multiple weight formats, step-by-step solutions, interactive visualizations, and example datasets.
Weighted Mean Frequencies Step-by-Step
Weighted Credits Calculator
Calculate weighted GPA, credit hours, and grade averages with multiple grade scales, quality points, and semester planning.
GPA Credit Hours Grades
Weighted Grade Calculator
Calculate weighted grades with assignment categories, percentage or points-based weighting, and detailed grade breakdowns.
Grades Assignments Weights
Weighted Average Cost Calculator
Calculate weighted average inventory cost with batch tracking, FIFO/LIFO/WAC comparison, COGS analysis, and cost per unit breakdowns.
Inventory COGS Cost Method
Weighted Average Interest Rate Calculator
Calculate weighted average interest rate for multiple loans with consolidation rate, debt analysis, and annual interest cost estimates.
Loans APR Consolidation
Weighted Mortgage Calculator
Calculate blended mortgage rate, combine multiple loans, and compare interest costs for smarter refinancing decisions.
Mortgage HELOC Refinance
Weighted Investment Calculator
Calculate portfolio weighted returns with asset allocation weights, contribution breakdown, and performance attribution analysis.
Portfolio Returns Allocation
Weighted Stock Average Calculator
Calculate average cost per share across multiple purchases. Track cost basis, unrealized P/L, break-even price, and plan future trades.
Stocks Cost Basis DCA
Weighted Average Yield Calculator
Calculate weighted portfolio yield across bonds, dividends, ETFs, and fixed income. Track yield contributions and income estimates.
Yield Bonds Income
Weighted Average Maturity Calculator
Calculate WAM for bond portfolios, loans, and MBS. Analyze interest rate risk, maturity exposure, and risk classification instantly.
WAM Bonds Rate Risk
Weighted Average Life Calculator
Calculate WAL for loans, bonds, MBS, and ABS. Analyze principal repayment schedules, prepayment scenarios, and cash flow timing.
WAL Principal Cash Flow
Weighted Duration Calculator
Calculate weighted average duration across multiple time periods with auto weight validation, normalization, and portfolio-level analysis.
Duration Portfolio Time
Weighted Salary Calculator
Calculate weighted average salary across roles and departments. Analyze total payroll, salary bands, and compensation benchmarks.
Salary Payroll HR
Weighted Hourly Rate Calculator
Calculate effective hourly rate across multiple jobs, shifts, and gigs with overtime multipliers and shift differentials.
Hourly Overtime Gig
Weighted Survey Calculator
Calculate weighted survey results with demographic weights, ESS, DEFF, weighted vs unweighted comparison, and weight distribution analysis.
Survey ESS Demographics
Weighted Density Calculator
Calculate mixture density for alloys, blends, and composites with mass/volume weighting, unit conversion, specific gravity, and material presets.
Density Materials Mixtures
Weighted Average Value Calculator
Multi-mode weighted average with contribution analysis, dominant factor detection, and comparison across simple, geometric, and harmonic means.
Value Multi-Mode Analysis

Frequently Asked Questions