The Sharpe ratio helps investors evaluate the relationship between risk and return for an asset. Since it was introduced by William Sharpe in the 1960s, the Sharpe ratio has become one of the most widely used metrics in finance and economics. By quantifying both volatility and performance, this tool allows for an incremental understanding of the use of risk to generate return. With the help of Microsoft Excel, the otherwise intimidating Sharpe ratio formula can be easily utilized.
Here is the standard Sharpe ratio equation:
Sharpe ratio = (Mean portfolio return − Risk-free rate)/Standard deviation of portfolio return, or,
S(x) = (rx - Rf) / StandDev(x)
To recreate this formula in Excel, create a time period column and insert values in ascending sequential order (1, 2, 3, 4, etc). Each time period is usually representative of either one month or one year. Then, create a second column next to it for returns and plot those values in the same row as their corresponding time period.
Source : Investopedia