Finance practice › Finance practice questions › Sharpe ratio practice
How to calculate the Sharpe ratio, with practice questions
The Sharpe ratio is the return an investment earned above a risk-free rate, divided by how much that return swung around: average excess return ÷ standard deviation. In Excel, with the monthly excess returns in C2:C13, it is =AVERAGE(C2:C13)/STDEV.S(C2:C13), and *SQRT(12) turns the monthly figure into an annual one.
The ten questions below work it out one step at a time on twelve real monthly returns of Apple's shares, then again on a different twelve months of the same shares, where it comes out negative. The prices are real; the risk-free rate (0.25% a month, 3% a year) is a practice assumption. Nothing here is a view on the stock.
The Sharpe ratio formula, step by step
- Return of each period = this period's closing price ÷ the previous period's − 1.
- Excess return = the return − the risk-free rate for the same period (the return on something like a short Treasury bill). William Sharpe, who devised the ratio, calls this the differential return.
- Average the excess returns, and take their standard deviation, the usual measure of how far the returns sit from their average.
- Sharpe ratio = average excess return ÷ standard deviation.
- Annualize: multiply a monthly ratio by √12 (a daily one by the square root of the number of trading days in a year).
When the risk-free rate is the same every month, as on this page, subtracting it moves every return by the same amount and leaves the standard deviation unchanged. That is why you can also compute the standard deviation on the plain returns and subtract the rate from the average alone.
In Excel, with the twelve returns in B2:B13 and the monthly risk-free rate in E1:
=B2-$E$1in C2, filled down to C13, gives the excess returns.=AVERAGE(C2:C13)/STDEV.S(C2:C13)is the monthly Sharpe ratio. STDEV.S is the standard deviation of a sample (it divides by n − 1); Sharpe's own example uses the same calculation.=AVERAGE(C2:C13)/STDEV.S(C2:C13)*SQRT(12)is the annualized one.
The numbers: Apple, Jul 2022 to Jun 2023
Apple's closing price on the last trading day of each month, and the return on the month before. The close at the end of Jun 2022 was $136.72.
| Month | Month-end close | Return |
|---|---|---|
| Jul 2022 | 162.51 | +18.86% |
| Aug 2022 | 157.22 | -3.26% |
| Sep 2022 | 138.20 | -12.10% |
| Oct 2022 | 153.34 | +10.96% |
| Nov 2022 | 148.03 | -3.46% |
| Dec 2022 | 129.93 | -12.23% |
| Jan 2023 | 144.29 | +11.05% |
| Feb 2023 | 147.41 | +2.16% |
| Mar 2023 | 164.90 | +11.86% |
| Apr 2023 | 169.68 | +2.90% |
| May 2023 | 177.25 | +4.46% |
| Jun 2023 | 193.97 | +9.43% |
These are price returns: dividends are not included. Copy the Return column into a spreadsheet if you want to follow along there.
Apple closed at $177.25 at the end of May 2023 and at $193.97 at the end of Jun 2023. What was the return for Jun 2023?
Show the answer
9.43%
193.97 ÷ 177.25 − 1 = 9.43%. It is the last row of the table above; every row is computed the same way.
What is the average of the twelve monthly returns in the table above (Jul 2022 to Jun 2023)? In Excel: =AVERAGE(B2:B13).
Show the answer
3.39%
The twelve returns add up to 40.65; ÷ 12 = 3.39% a month. (Over the whole period the price went from $136.72 to $193.97, a change of 41.87%: not the same as the sum, because monthly returns compound.)
The average monthly return was 3.39%. Assume a risk-free rate of 0.25% a month (3% a year). What was the average excess return per month?
Show the answer
3.14%
3.39% − 0.25% = 3.14% a month. The risk-free rate has to cover the same length of time as the returns: a monthly rate against monthly returns.
Take each of the twelve returns, subtract the average (3.39%) and square the result: those twelve squares add up to 1,041.49. What is the sample standard deviation of the monthly returns? In Excel: =STDEV.S(B2:B13).
Show the answer
9.73%
1,041.49 ÷ 11 = 94.68 (the variance); its square root is 9.73%. In a typical month the return sat about 10 percentage points away from the average. Dividing by 12 instead of 11 would give 9.32%; with only twelve observations the choice shows, with sixty it barely would.
Average excess return: 3.14% a month. Standard deviation: 9.73% a month. What is the monthly Sharpe ratio? Give two decimals.
Show the answer
0.32
3.14 ÷ 9.73 = 0.32: for each percentage point of monthly swing, 0.32 points of return above the risk-free rate. On its own the figure says little; it is made to be compared with another investment's over the same period.
The monthly Sharpe ratio is 0.322. What is the annualized Sharpe ratio? Give two decimals.
Show the answer
1.12
0.322 × √12 = 0.322 × 3.464 = 1.12. Over twelve months the average return adds up twelve times, while the standard deviation grows by √12 if one month's return tells you nothing about the next. Twelve divided by √12 is √12, so that is the factor for the ratio. Sharpe ratios are nearly always quoted annualized, so check that two you compare both are.
The same shares, another twelve months: Jan 2022 to Dec 2022
| Month | Month-end close | Return |
|---|---|---|
| Jan 2022 | 174.78 | -1.57% |
| Feb 2022 | 165.12 | -5.53% |
| Mar 2022 | 174.61 | +5.75% |
| Apr 2022 | 157.65 | -9.71% |
| May 2022 | 148.84 | -5.59% |
| Jun 2022 | 136.72 | -8.14% |
| Jul 2022 | 162.51 | +18.86% |
| Aug 2022 | 157.22 | -3.26% |
| Sep 2022 | 138.20 | -12.10% |
| Oct 2022 | 153.34 | +10.96% |
| Nov 2022 | 148.03 | -3.46% |
| Dec 2022 | 129.93 | -12.23% |
Average monthly return: -2.17%. Sample standard deviation: 9.51%. The two periods share 6 months (Jul 2022 to Dec 2022).
In calendar 2022 Apple's average monthly return was -2.17% with a standard deviation of 9.51%. With the same risk-free rate of 0.25% a month, what was the annualized Sharpe ratio for 2022? Two decimals, with its sign.
Show the answer
-0.88
Excess return = -2.17% − 0.25% = -2.42%. -2.42 ÷ 9.51 = -0.254 a month; × √12 = -0.88. A negative Sharpe ratio says the investment returned less than the risk-free rate over the period. Beyond that it is hard to read: among negative ratios, more volatility makes the figure look better (closer to zero), which is the opposite of what the ratio is for.
Same shares, same method, same risk-free rate: the annualized Sharpe ratio is 1.12 for Jul 2022 to Jun 2023 and -0.88 for calendar 2022, and the two periods share 6 months. Which one is Apple's Sharpe ratio?
Show the answer
Both are right for their own twelve months. A Sharpe ratio describes a chosen past period; it is not a fixed property of the stock.
Both are correct. In William Sharpe's own words, the ratio is "not independent of the time period over which it is measured." Move the window six months and the answer goes from -0.88 to 1.12. So a Sharpe ratio always comes with three labels: the period, the frequency of the returns (monthly here) and the risk-free rate used. A figure quoted without them can't be compared with anything.
The same year, 2022, measured on daily returns: Apple's shares traded on 251 days, the average daily excess return was -0.1112% and the standard deviation of daily returns 2.249%, which gives a daily Sharpe ratio of -0.0495. Annualize it. Two decimals, with its sign.
Show the answer
-0.78
-0.0495 × √251 = -0.0495 × 15.84 = -0.78. The monthly returns of the same year gave -0.88. The two don't match exactly, because the √ rule assumes that each period's return is unrelated to the one before, and real returns only roughly behave that way. Many people use 252 for the number of trading days in a year; this data has 251 for 2022.
In Jul 2022 Apple's shares rose 18.86%, the largest move of the twelve months in the first table. What did that month do to the Sharpe ratio for the period?
Show the answer
It raised the average return and it raised the standard deviation too, because standard deviation counts a large swing up exactly like a large swing down.
Without Jul 2022, the other eleven months average 1.98% with a standard deviation of 8.83%; with it, 3.39% and 9.73%. The best month of the period counts as risk in the denominator. That is the main thing to remember about the Sharpe ratio: it treats all variability alike, the kind investors fear and the kind they hope for. It also describes the past and says nothing about the next twelve months.
Questions people ask
How do I calculate the Sharpe ratio in Excel?
Put the period returns in one column (B2:B13 for twelve months) and the risk-free rate for one period in a cell (E1). In C2 type =B2-$E$1 and fill it down. The Sharpe ratio is =AVERAGE(C2:C13)/STDEV.S(C2:C13); for an annual figure from monthly returns, multiply by SQRT(12). On the twelve Apple returns at the top of this page, with 0.25% in E1, that gives 0.32 and 1.12.
Should I use STDEV.S or STDEV.P for the Sharpe ratio?
STDEV.S, the sample standard deviation, which divides by n − 1: a run of past returns is a sample, not every return the investment will ever have. It is also what the formula in Sharpe's own article computes. The gap between the two shrinks as the number of returns grows: with twelve months it is 9.73% against 9.32% here.
Why multiply by the square root of 12?
Because the two halves of the ratio grow at different speeds. Over twelve months the average return is twelve times the monthly one, while the standard deviation is √12 times the monthly one if the months are unrelated to each other. Twelve ÷ √12 = √12. For daily returns the factor is the square root of the number of trading days, for weekly returns √52.
What is a good Sharpe ratio?
There is no figure that holds everywhere. People quote rules of thumb such as "above 1 is good", but the same shares gave 1.12 and -0.88 on this page, twelve months each, half a year apart. A Sharpe ratio is useful for comparing two investments over the same period, with the same return frequency and the same risk-free rate, and of little use as a score on its own.
What does a negative Sharpe ratio mean?
That the investment returned less than the risk-free rate over the period: the top of the fraction is negative. It is a description of that period, as in Apple's 2022 above (-0.88), and ranking negative ratios against each other is unreliable, because a higher standard deviation pulls a negative ratio toward zero.