View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chris Maddogz Chris Maddogz is offline
external usenet poster
 
Posts: 32
Default Share Portfolio - Averaging the Cost per Shareholding

I have a portfolio of shares stored in an Excel Workbook called Super 2
Etrade Contract Layout - the worksheet is called Super2 Holdings.
I need a macro to help me work out the average cost of each share held.

The Stock Codes (in Alpha order) are in Column C starting at C4.

The Quanitity per trade is is in Column F starting at F4.

The Total Cost per trade is in K starting at K4

I need to accumulate the Total Quantity per Stock and Total Cost per Stock
into Column N & O respectively on the row of the last entry for the Stock -
then divide that Total Cost by Total Quantity and put the result into Column
P of the last entry for that stock.

Then move onto the next code and continue the calcluation until until there
are no entries in Column C (ie the Stock Code in Column C is blank)