You are on page 1of 6

This neat spreadsheet is the work of Michael Kishinevsky !!

Name the cell with the risk-free rate rfr: Department of Finance
rfr =prices!$D$1 Lubin Business School
Pace University
Define named range start in the top-left corner of the prices: http://webpage.pace.edu/mkishinevsky/
start =prices!$B$5

Define datesCount and pricesCount:


datesCount =COUNTA(OFFSET(start,0,0,10000,1))
stocksCount =COUNTA(OFFSET(start,0,0,1,250))

Determine if the price are daily, weekly, or monthly:


date1 =OFFSET(start,0,-1)
date2 =OFFSET(start,1,-1)
dd =date2-date1
n =IF(dd>25,12,IF(dd>5,52,365))

Define price0 and price1 ranges:


price0 =OFFSET(start,0,0,datesCount-1,stocksCount)
price1 =OFFSET(start,1,0,datesCount-1,stocksCount)

Compute returns
returns =LN(price1/price0)

Compute row vector of ones, mean returns, annualized mean returns and standard deviations.
returns =LN(price1/price0)
ones =COLUMN(OFFSET(start,0,0,1,datesCount-1))/COLUMN(OFFSET(start,0,0,1,datesCount-1
mean =MMULT(ones,returns)/ROWS(returns)
meanAnnualized =mean*n
sdAnnualized =SQRT(MMULT(ones,(returns-mean)^2)/ROWS(returns))*SQRT(n)

Use meanAnnualized and sdAnnualized for the "Asset Returns" series of the efficient frontier chart.

Compute variance-covariance matrix (S)


S =MMULT(TRANSPOSE(returns-mean),(returns-mean))/ROWS(returns)

Compute z-vector, x-vector, market portfolio expected return, and standard deviation
z =MMULT(mean-rfr,MINVERSE(S))
x =z/SUM(z)
erp =MMULT(mean,TRANSPOSE(x))
sdp =SQRT(MMULT(x,MMULT(S,TRANSPOSE(x))))

Plot the Capital Market Line using tlx and tly:


tlx =(COLUMN(prices!$A$4:$C$4)-1)*sdp
tly =(COLUMN(prices!$A$4:$C$4)-1)*(erp-rfr)+rfr

Use MIN(mean) and MAX(mean) as risk-free rates for finding portfolios A and B:
zA =MMULT(mean+MIN(mean),MINVERSE(S))
zB =MMULT(mean-MAX(mean),MINVERSE(S))
xA =zA/SUM(zA)
xB =zB/SUM(zB)
erpA =MMULT(mean,TRANSPOSE(xA))*n
erpB =MMULT(mean,TRANSPOSE(xB))*n
sdpA =SQRT(MMULT(xA,MMULT(S,TRANSPOSE(xA))))*SQRT(n)
sdpB =SQRT(MMULT(xB,MMULT(S,TRANSPOSE(xB))))*SQRT(n)
covarAB =MMULT(xA,MMULT(S,TRANSPOSE(xB)))*12

Any point on the efficient frontier can be found by combining these two portfolios.
Plot the efficient frontier using efx and efy:
maxA =2
minA =0
steps =30
a =minA+(COLUMN(OFFSET(start,0,0,1,steps))-1)*(maxA-minA)/(steps-1)
b =1-a
efy =erpA*a+erpB*b
efx =SQRT((a*sdpA)^2+(b*sdpB)^2+2*a*b*covarAB)
Kishinevsky !!

e.edu/mkishinevsky/

N(OFFSET(start,0,0,1,datesCount-1))

ROWS(returns)
-minA)/(steps-1)
Mean Return (Monthly) = 1.00% 1.20% -0.50% 1.10% Fill in the data with
Volatility (Monthly) = 3.00% 2.00% 5.00% 1.00% Risk-Free Rate = 4%
Table of Asset Prices
Dates Asset A Asset B Asset C Asset D
Jan-01 10.00 10.00 10.00 10.00 12
Feb-01 10.25 10.27 9.46 10.09
Mar-01 10.38 10.21 9.06 10.19
Apr-01 10.56 10.28 8.57 10.29
May-01 10.47 10.23 8.68 10.38 10

Jun-01 10.70 10.10 7.92 10.66


Jul-01 10.89 10.16 7.85 10.79
Aug-01 11.03 10.11 7.19 10.88 8
Sep-01 11.38 9.90 7.18 10.95
Oct-01 10.95 9.71 7.22 11.16
Nov-01 11.04 10.05 7.72 11.30
Dec-01 11.30 10.11 7.81 11.60 6
Jan-02 11.49 9.92 7.80 11.68
Feb-02 11.97 9.96 7.86 11.68
Mar-02 12.42 10.11 8.06 11.85
4
Apr-02 12.28 10.12 8.31 12.10
May-02 12.37 10.51 8.16 12.23
Jun-02 11.97 10.98 8.81 12.70
Jul-02 12.13 11.22 8.56 12.79 2
Aug-02 12.40 11.50 8.18 12.83
Sep-02 11.97 11.74 8.33 13.04
Oct-02 12.38 12.00 8.79 13.27
Nov-02 12.68 12.24 7.95 13.50 0
Dec-02 12.40 12.61 7.65 13.49 0% 200% 400% 600% 800
Jan-03 12.42 12.61 7.65 13.50
Feb-03 12.84 12.75 7.66 13.73
Mar-03 12.95 12.81 7.42 13.93
Apr-03 13.50 12.70 7.07 14.01
May-03 13.77 12.72 6.81 14.26
Jun-03 13.97 12.62 7.14 14.56
Jul-03 13.99 12.71 6.79 14.53
Aug-03 14.29 12.71 6.78 14.87
Sep-03 15.05 12.66 6.72 14.99
Oct-03 15.58 12.28 6.34 15.25
Nov-03 16.32 12.08 5.66 15.44
Dec-03 16.18 12.23 5.67 15.88
Fill in the data within the boxes and hit F9 (again and again !)
(annualized) See : http://www.gummy-stuff.org/sampling-Frontier.htm

Efficient Frontier
Asset Returns
Capital Market Line
Market Portfolio
Risk-free Rate

400% 600% 800% 1000% 1200%

You might also like