Average Share Price Calculator

Average Share Price Calculator

Use this calculator to determine your average cost per share when you've made multiple purchases of the same stock at different prices. This is often referred to as your cost basis.

Understanding Your Average Share Price

When you invest in stocks, it's common to buy shares at different times and at different prices. Your "average share price," also known as your cost basis, is the average price you've paid for all the shares you currently own of a particular stock.

This metric is crucial for several reasons:

  • Profit/Loss Assessment: It helps you quickly determine if your current investment is in profit or loss. If the current market price is above your average share price, you're in profit; if it's below, you're at a loss.
  • Dollar-Cost Averaging (DCA): DCA is an investment strategy where you invest a fixed amount of money regularly, regardless of the share price. This often leads to a lower average share price over time, especially in volatile markets, as you buy more shares when prices are low and fewer when prices are high.
  • Tax Implications: For tax purposes, your cost basis (average share price) is essential for calculating capital gains or losses when you sell your shares.
  • Investment Decisions: Knowing your average price can influence decisions about whether to buy more, hold, or sell, especially when considering market fluctuations.

How to Use the Calculator

  1. Enter Share Price: For each purchase you've made, enter the price you paid per share.
  2. Enter Number of Shares: For each corresponding purchase, enter the quantity of shares you bought.
  3. Add More Purchases (Optional): The calculator provides fields for up to five separate purchases. If you have fewer, leave the unused fields blank.
  4. Calculate: Click the "Calculate Average Price" button.

Example Calculation

Let's say you made the following purchases for a stock:

  • Purchase 1: 10 shares at $100.00 per share
  • Purchase 2: 15 shares at $95.00 per share
  • Purchase 3: 5 shares at $110.00 per share

Here's how the average share price is calculated:

  1. Calculate Total Cost for Each Purchase:
    • Purchase 1: 10 shares × $100.00/share = $1,000.00
    • Purchase 2: 15 shares × $95.00/share = $1,425.00
    • Purchase 3: 5 shares × $110.00/share = $550.00
  2. Calculate Total Investment Cost:
    • $1,000.00 + $1,425.00 + $550.00 = $2,975.00
  3. Calculate Total Number of Shares:
    • 10 shares + 15 shares + 5 shares = 30 shares
  4. Calculate Average Share Price:
    • $2,975.00 / 30 shares = $99.17 per share (rounded to two decimal places)

So, your average share price for this stock is $99.17.

.average-share-price-calculator { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f9f9f9; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); max-width: 700px; margin: 20px auto; color: #333; } .average-share-price-calculator h2, .average-share-price-calculator h3 { color: #0056b3; text-align: center; margin-bottom: 15px; } .average-share-price-calculator p { line-height: 1.6; margin-bottom: 10px; } .average-share-price-calculator .input-group { margin-bottom: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; } .average-share-price-calculator .input-group label { flex: 1 1 180px; /* Adjust label width */ font-weight: bold; color: #555; } .average-share-price-calculator .input-group input[type="number"] { flex: 2 1 250px; /* Adjust input width */ padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 16px; } .average-share-price-calculator button { display: block; width: 100%; padding: 12px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; font-size: 18px; cursor: pointer; transition: background-color 0.3s ease; margin-top: 20px; } .average-share-price-calculator button:hover { background-color: #0056b3; } .average-share-price-calculator .calculator-result { background-color: #e9f7ff; border: 1px solid #b3e0ff; padding: 15px; border-radius: 8px; margin-top: 25px; font-size: 1.1em; color: #004085; } .average-share-price-calculator .calculator-result p { margin: 5px 0; } .average-share-price-calculator .calculator-result strong { color: #0056b3; } .average-share-price-calculator ul { list-style-type: disc; margin-left: 20px; margin-bottom: 10px; } .average-share-price-calculator ol { list-style-type: decimal; margin-left: 20px; margin-bottom: 10px; } .average-share-price-calculator li { margin-bottom: 5px; } function calculateAverageSharePrice() { var totalShares = 0; var totalCost = 0; var numPurchases = 5; // Number of purchase input pairs for (var i = 1; i 0 && !isNaN(quantity) && quantity > 0) { totalShares += quantity; totalCost += (price * quantity); } } var resultDiv = document.getElementById("averageSharePriceResult"); resultDiv.innerHTML = ""; // Clear previous results if (totalShares > 0) { var averagePrice = totalCost / totalShares; resultDiv.innerHTML = "Calculation Results:" + "Total Shares Owned: " + totalShares.toFixed(0) + "" + "Total Investment Cost: $" + totalCost.toFixed(2) + "" + "Average Share Price: $" + averagePrice.toFixed(2) + ""; } else { resultDiv.innerHTML = "Please enter valid share prices and quantities for at least one purchase to calculate the average."; } }

Leave a Comment