I have a list of stock trades (see attached sample WS) and am trying to write a formula(s) to calculate the monthly values based on the investments in the portfolio at month's end. Since the shares purchased amount is calculated based on the sale proceeds of the stock sold on same date we just need to know what positions are in the portfolio and their price at month's end. The portfolio only has 2 positions at all times and they can be 2 stocks, 1 stock and 1 Cash position, or 2 Cash positions. Cash is treated as a stock position and it's price is always $1.
I can use the following to find the month end price for a stock based on the purchase date but this doesn't work when it's owned into another month.
=VLOOKUP(WORKDAY(DATE(YEAR(B18),MONTH(B18)+1,1),-1),Prices!$A$1:$S$1911,MATCH(A18,Prices!$A$1:$S$1,0),0)
So how can I:
1. find both securities are in the portfolio at the end of each month and their share amount? (Remember some positions are owned for multiple months but share quantity doesn't change.)
2. multiply the shares bought for each security owned at month's end by the month end price. (All prices are stored in another worksheet called Prices with Column A holding the date and Row 1 the stock symbol. (Prices!$A$1:$S$1911)
3. add the month end values of both securities together and put in a cell.
Sample Output: (actual results I calculated manually)
Jan 2007 20000
Feb-2007 20000
Mar 2007 20000
Apr 2007 20416.21
May 2007 21341.15
Thanks,
Doug
I can use the following to find the month end price for a stock based on the purchase date but this doesn't work when it's owned into another month.
=VLOOKUP(WORKDAY(DATE(YEAR(B18),MONTH(B18)+1,1),-1),Prices!$A$1:$S$1911,MATCH(A18,Prices!$A$1:$S$1,0),0)
So how can I:
1. find both securities are in the portfolio at the end of each month and their share amount? (Remember some positions are owned for multiple months but share quantity doesn't change.)
2. multiply the shares bought for each security owned at month's end by the month end price. (All prices are stored in another worksheet called Prices with Column A holding the date and Row 1 the stock symbol. (Prices!$A$1:$S$1911)
3. add the month end values of both securities together and put in a cell.
Sample Output: (actual results I calculated manually)
Jan 2007 20000
Feb-2007 20000
Mar 2007 20000
Apr 2007 20416.21
May 2007 21341.15
Thanks,
Doug