Complete guide on how to calculate the average price of a stock
Learn how to calculate the average price of your shares

Investing in the stock market can feel like a complex game, especially when you start buying shares at different prices. If you’ve ever wondered how to figure out your true cost per share after multiple purchases, you’re in the right place. Understanding how to calculate the average price of a stock is a fundamental skill for any investor, helping you make smarter decisions and assess your real returns.
This guide will break down everything you need to know about calculating your average stock price, making it easy even for those new to investing.
Why is Calculating Your Average Stock Price So Important?
Knowing your average stock price isn’t just a number; it’s a powerful tool for informed investing. Here’s why it matters:
- Accurate Profit/Loss Assessment: Without it, you can’t accurately determine your profit or loss on an investment. If you bought shares at $10 and then at $12, selling at $11 might seem like a loss on the second batch, but if your average is $10.50, you’re actually up!
- Informed Selling Decisions: It helps you set realistic selling targets. You’ll know the price point at which you break even or start making a profit.
- Dollar-Cost Averaging Strategy: This calculation is crucial for the popular dollar-cost averaging (DCA) strategy, where you invest a fixed amount regularly, regardless of the stock price. DCA aims to reduce your average cost over time.
- Tax Reporting: For tax purposes, knowing your cost basis (which is directly related to your average price) is essential for reporting capital gains or losses.
The Simple Formula: How to Calculate Average Stock Price
Let’s get straight to it. The core concept is straightforward: you sum up the total cost of all your purchases and divide it by the total number of shares you own.
Here’s the basic formula:
Let’s look at an example.
Example 1: Buying in Two Batches
Imagine you made the following purchases of Company XYZ shares:
- Purchase 1: 10 shares at $50 per share
- Purchase 2: 15 shares at $40 per share
Step 1: Calculate the total cost of each purchase.
- Purchase 1 Cost:
- Purchase 2 Cost:
Step 2: Calculate the total cost of all shares.
- Total Cost:
Step 3: Calculate the total number of shares owned.
- Total Shares:
Step 4: Apply the average price formula.
- Average Price:
So, even though you bought shares at $50 and $40, your average price for Company XYZ stock is $44 per share.
Handling Brokerage Fees: A Crucial Detail for Accurate Calculation
Many new investors overlook brokerage fees (commissions) when calculating their average price. However, these fees are part of your total cost and can impact your average significantly, especially with smaller trades.
The updated formula, including fees, is:
Let’s revisit our example, adding a $5 fee for each purchase.
Example 2: Including Brokerage Fees
- Purchase 1: 10 shares at $50 per share + $5 fee
- Purchase 2: 15 shares at $40 per share + $5 fee
Step 1: Calculate the total cost of each purchase, including fees.
- Purchase 1 Cost:
- Purchase 2 Cost:
Step 2: Calculate the total cost of all shares, including fees.
- Total Cost:
Step 3: Calculate the total number of shares owned (this remains the same).
- Total Shares:
Step 4: Apply the average price formula with fees.
- Average Price:
As you can see, including fees increased your average price from $44 to $44.40. While seemingly small, these differences add up over many trades and can significantly affect your overall returns.
Advanced Scenarios: What About Selling Shares or Stock Splits?
Calculating your average price becomes a bit more dynamic when you sell some shares or when a company has a stock split.
Selling Shares
When you sell shares, your average cost for the remaining shares doesn’t change unless you repurchase them. The average cost calculation only applies to the shares you currently hold.
Example: If you had 25 shares of Company XYZ with an average cost of $44.40 and you sold 10 shares, your average cost for the remaining 15 shares is still $44.40. You would then calculate your capital gain or loss on the 10 shares you sold based on their average cost of $44.40.
Stock Splits
A stock split occurs when a company increases the number of its outstanding shares by dividing each existing share into multiple shares. While the number of shares changes, your total investment value remains the same, which means your average price per share will adjust proportionally.
Example: 2-for-1 Stock Split
You own 100 shares of Company ABC with an average price of $100 per share.
Total Investment Value: 100 shares×$100/share=$10,000
If Company ABC announces a 2-for-1 stock split:
- You will now own .
- Your new average price per share will be .
Notice that your total investment value remains . Stock splits simplify the share price; they don’t change your investment’s value or your overall cost basis.
Tools to Help You Track Your Average Price
While manual calculation is good for understanding, for active investors, several tools can automate this for you:
- Brokerage Platforms: Most online brokerage accounts automatically display your average cost basis for each stock you own. This is usually the most reliable source.
- Spreadsheets (Excel/Google Sheets): For those who like to keep detailed records, a simple spreadsheet can be set up to track your purchases, fees, and calculate your average price automatically.
- Portfolio Trackers: Many third-party portfolio management apps and websites offer features to track your cost basis and average price across multiple brokers.
Final Thoughts on Your Investment Journey
Understanding how to calculate the average price of your stocks is a cornerstone of smart investing. It empowers you to:
- Make better buy and sell decisions.
- Effectively implement strategies like dollar-cost averaging.
- Accurately assess your portfolio’s performance.
Always remember to include all costs, especially brokerage fees, for the most accurate picture. Happy investing!