Average Share Price Calculator

Average share price, or dollar cost averaging, is the average price that you have paid for a stock. If you have purchased an investment multiple times at different price points, it may be difficult to know exactly how much you've invested.

That is why we created this tool to help you determine the average price you've paid for a single stock. In the table below enter the amount of shares you purchased in the left column, and in the right column enter the prices you paid at the time of purchase. When you've entered the values, click calculate and you will find your average cost per share.

# Shares Price
1 $
2 $
3 $
4 $
5 $

Average Price

0

<!--

Average Shares

0

-->
$(document).ready(function($){ console.log('jquery is working like a super champ!') $('#calculate').on('click', function(e){ e.preventDefault(); let shares = 0; let prices = 0; let numberOne = parseFloat($('#number-one').val()); let numberTwo = parseFloat($('#number-two').val()); let numberThree = parseFloat($('#number-three').val()); let numberFour = parseFloat($('#number-four').val()); let numberFive = parseFloat($('#number-five').val()); let priceOne = parseFloat($('#price-one').val()); let priceTwo = parseFloat($('#price-two').val()); let priceThree = parseFloat($('#price-three').val()); let priceFour = parseFloat($('#price-four').val()); let priceFive = parseFloat($('#price-five').val()); let timesOne = numberOne * priceOne; let timesTwo = numberTwo * priceTwo; let timesThree = numberThree * priceThree; let timesFour = numberFour * priceFour; let timesFive = numberFive * priceFive; prices = timesOne + timesTwo + timesThree + timesFour + timesFive; shares = shares + numberOne + numberTwo + numberThree + numberFour + numberFive; let dividePrices = parseFloat(prices / shares).toFixed(2); $('#average-price-div').show(); $('#average-price').text(`The average price you paid is $${dividePrices} per share.`); console.log('this is number of shares', shares); }) });
>