Question: How to handle large amount of data and calculate returns in a column matrix

ok, I have an excel sheet contaning three columns of data for 250 stocks .  

time          stock             close

2005         stock A           200

2006         stock A           300

2005         stock B          100

2006         stock B          150

 etc              etc                  etc

 

1) The first question is how can I get  the close organised in a column matrix

stock_price:= <  <Stock A]> | <Stock B> | <Stock c > | <Stock i >   >;

that have the structure

stock A         Stock B           Stock C

close t           close t            close t

close t+1      close t+1        close t+1

I would assume that we would need some sort of loop that checks if the name in the stock column is different and

if it is different starts a new column. I have not figured out how to do this.

 

2) My second question is: How can we calculate the returns P(t+1)-P(t)  in an easy way

and also display that it in a column matrix

 

 

 

Please Wait...