How to Calculate Beta in Excel (4 Easy Methods)

Beta measures the stock’s sensitivity to market movement. Precisely, it is the safety and risk assessment of a certain asset. There are different methods for calculating beta. You can use the regression between the two sets of data to calculate the beta. This article focuses on four effective and quick ways how to calculate beta in Excel.

Overview image to calculate beta in Excel

Introduction to Beta in Stock Market

What Is Beta (β):

If you are keen to know about the stock market or wish to gather ideas for your future investment in a share, you should be familiar with the calculation of beta. Beta signifies the measure of the volatility of an asset compared to the overall market price. Generally, this term refers to the stock market. A share’s volatility is measured through beta.

Volatility refers to the degree of variation in the price or value of an asset over time. We need to calculate the beta to get a clear picture of the volatility of that particular asset. We have calculated the beta compared to the overall market price, which is the “S&P 500” index.

Significance of Calculating Beta:

  • Beta Zero: A beta of 0 means that there is no correlation between the asset’s returns and market returns. In other words, the performance of the asset is unaffected by changes in the market.
  • 0<Beta<1: A beta value between 0 and 1 denotes that an asset’s returns are less volatile than those of the market. In other words, the asset may offer a more steady return since it is less susceptible to market fluctuations.
  • Beta = 1: A beta value of 1 means that the asset’s returns follow the performance of the market. The asset’s performance is similar to the market’s performance.
  • Beta > 1: A beta greater than 1 indicates that the asset’s returns are more volatile than the market returns. In other words, the asset is more sensitive to market movements and may experience larger fluctuations in price.
  • Beta<0: It indicates the stock price is moving oppositely with the market value. If the market’s share price moves upward then the price of that particular share moves downward.

Required Information to Calculate Beta:

We need to calculate the returns of the stock price and the returns of the market’s price while calculating the beta. The returns mean the value fluctuates from the previous one. It can be determined daily, weekly, monthly, or yearly. The closing value of a particular stock is compared with the closing value of the overall market price (“S&P 500”). The return value is calculated from the present value and the initial value.

Returns=(Present value – Initial value)/Initial value

After calculating the returns, you can calculate beta through various methods that we have stated below.

How to Calculate Beta in Excel: 4 Easy Ways

There are several methods to calculate beta in Excel. But first, you need to create a dataset where you need to insert the closing values of the stock. It can be daily, weekly, monthly, or yearly. Also, you need to set the market value. Here, we have taken a dataset of the “Monthly Closing of the Stock Price of ABC company”. We also take a dataset of the monthly closing of “The S&P 500” for the same year. The sensitivity and the future risk will be calculated through beta.

Sample Dataset

Not to mention, we have used the Microsoft 365 version. You may use any other version at your convenience.

1. Using COVARIANCE & VARIANCE Functions to Calculate Beta in Excel

While calculating the beta, you need to calculate the returns of your stock price first. Then you can use the COVARIANCE.P and VAR.P functions. The output will show you the beta, from which you can make a decision about your future investment. Follow the below steps to calculate the beta.


  • First, go to cell D6, and enter the below formula.


C5 is the initial value of the stock and C6 is the present value of stock

Here, the output gives you the returns on your stock price. We have to leave the initial price of the stock.

  • Press ENTER, and drag it down for the other cells with the Fill Handle tool.

Calculating returns of the stock

  • Now, we need to calculate the returns of the market value following the same process.
  • Insert the below formula in the H6 cell.


G5= Initial price of the overall market.

G6= Present price of the overall market.

We subtracted the initial value from the final value and divided it by the initial value.

  • Press ENTER, and drag it down for other cells.

Calculating returns of the overall market

  • Finally, we need to calculate the beta. For this insert the below formula in cell C18.

Here, COVARIANCE.P(D6:D16, H6:H16) estimates the covariance between D6:D16 and H6:H16. Then we divided the value by VAR.P(H6:H16) where VAR.P calculates the variance of H6:H16 cells, which is the market’s return value.

  • Press ENTER, and you will get the beta of your stock.

using COVARIANCE and VARIANCE functions to calculate beta in Excel

In the below image, you can see that the beta is -0.03196. The negative sign indicates that your stock behaves oppositely in contrast with the overall market. In other words, when the market value goes up, the stock price of our dataset will fall down, and vice-versa.

2. Using SLOPE Function to Determine Beta

The SLOPE function refers to the linear regression of a straight line. Mainly, it also estimates the covariance between the stock returns and the market returns by multiplying the deviations of each data point from their respective means and taking the average of the resulting products. The formula we have used here is stated below.


Here, the SLOPE function calculates the linear regression that best fits the data in cells D6:D16 (dependent variable) and the data in cells H6:H16 (independent variable).

  • Press ENTER, and you have calculated the beta for your dataset. The output is shown in the below image.

Using the SLOPE function to calculate beta in Excel

Read More: How to Calculate CAPM Beta in Excel

3. Applying Regression from Data Analysis Tools

You can also find the beta from the linear regression using the Data Analysis tool. This analyzing tool needs to be brought into the ribbon first. You can add the Data Analysis by following the below process.


  • Initially, right-click on the ribbon and choose the Customize the Ribbon option. It will open the Excel Options.

customizing ribbon to open Excel options

  • From the Excel Options window, select Add-ins. Then choose the Excel Add-ins from the Manage group and hit Go.

Excel options window to add a add-ins

  • Now, from the Add-ins window select the Analysis ToolPak box and click on OK.

Add-ins window to insert Analysis ToolPak

  • After that, navigate to the Data tab >> from the Analyze group, and pick up the Data Analysis.

Choosing Data Analysis from the analyze group

  • Apparently, the Data Analysis window appears. Select Regression from there and click on OK.

Selecting Regression from the Data Analysis window

  • Consequently, the Regression window appears. Select $D$6:$D$16 in the Input Y Range and $H$6:$H$16 in the Input X Range. Click on OK.

Inserting X and Y values in the regression window

  • Finally, a new sheet will be opened showing the regression result (See the below image). The Coefficients of X Variable 1 are our calculated beta.

Showing beta from the regression sheet

Read More: How to Calculate Alpha in Excel

4. Creating a User-Defined Function with VBA to Calculate Beta

We have tried to insert VBA code to create a VBA user-defined function in our dataset. The code will create a function named Beta from which we can calculate the beta in our dataset. Follow the below steps.


  • First, hover over the Developer tab >> choose Visual Basic.

Launching developer tab

Note: By default, the Developer tab remains hidden. In that case, you have to enable the Developer tab.
  • Apparently, the Visual Basic Editor window opens. Select the Insert tab >> Module >> Module1.

Inserting module from the Visual Basic Editor group

  • Write the below VBA code there.
Function Beta(Range1 As Range, Range2 As Range) As Variant
'Calculate the Beta coefficient using linear regression
Dim X As Variant
Dim Y As Variant
Dim SumX As Double
Dim SumY As Double
Dim SumXY As Double
Dim SumX2 As Double
Dim SumY2 As Double
Dim n As Integer
Dim i As Integer
Dim Sxy As Double
Dim Sxx As Double
Dim Syy As Double
'Convert range values to arrays
X = Range1.Value
Y = Range2.Value
'Get the number of observations
n = UBound(X)
'Calculate the sums of X, Y, X*Y, X^2 and Y^2
For i = 1 To n
SumX = SumX + X(i, 1)
SumY = SumY + Y(i, 1)
SumXY = SumXY + X(i, 1) * Y(i, 1)
SumX2 = SumX2 + X(i, 1) ^ 2
SumY2 = SumY2 + Y(i, 1) ^ 2
Next i
'Calculate the slope and intercept coefficients
Sxy = SumXY - SumX * SumY / n
Sxx = SumX2 - SumX * SumX / n
Syy = SumY2 - SumY * SumY / n
Beta = Sxy / Sxx
End Function

VBA code to create a user-defined function to calculate beta

Code Breakdown:

  • The function takes two arguments which are the two sets of data that will be used to calculate the beta coefficient.
  • It takes a number of variables, including arrays for the X and Y values. There are variables for the sums of X, Y, X*Y, , and .
  • Then it estimates the sums of X, Y, X*Y,, and through the iteration of For Loop.
  • Using the sums the function then calculates the slope and intercept coefficients of the linear regression line.
  • Lastly, the function finds the beta by dividing the slope coefficient (Sxy/Sxx).

Now, go to your worksheet and select any cell where you want to put the formula. In our dataset, we entered the formula in the C18 cell. The formula is:


Here, the “Beta” is a user-defined function. It takes Range1 as the first argument, which is the independent variable array, and Range2 as the second argument, which is the dependent variable array.

  • After inserting the formula, press ENTER to get the output.

using beta function created from VBA

Read More: How to Calculate the Alpha of a Stock in Excel

Frequently Asked Questions

  • Is beta a percentage?
    Answer: A statistical measure of a company’s stock price’s volatility in relation to the entire stock market is called beta. It is computed by regressing a stock’s or portfolio’s percentage change against the market’s percentage change.
  • Is beta the risk-free rate?
    Answer: A risk-free asset has a beta of 0 since its covariance with the market is also zero. The market’s beta is one by definition, and the majority of developed market equities have strong positive betas.
  • What does a beta value of 0.8 mean?
    Answer: A stock with a beta of 0.8 is predicted to perform 80% better than the market as a whole. A stock’s movement would be 20% more than the market’s movement if its beta was 1.2.

Things to Remember

  • To calculate beta, you need data for both the stock or portfolio you are analyzing and the market index you are using as a benchmark. Make sure that you have the correct data and that it covers the same time period.
  • The stock price and the market price should have the same frequency whether it is daily, weekly, or monthly data. You need to convert it in the same time period and the same frequency.
  • To calculate beta, you need to find the returns of the stock, not the price. You can keep the returns in percentage forms.

Download Practice Workbook

Download the following practice workbook. It will help you understand the topic more clearly.


So, this is the end of our article. We believe you understand the above methods to calculate beta in Excel. It will help you understand a stock’s price behavior with respect to the market’s movement. We have tried to cover all the methods and show you the presentation of the methods. If you find any kind of difficulty in calculating beta, you can contact us through emails or comments. Also, if you have any Excel-related problems, feel free to contact us. Till then, goodbye!

Related Articles

<< Go Back to Stocks In Excel| Excel for Finance | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Fahim Shahriyar Dipto
Fahim Shahriyar Dipto

Fahim Shahriyar Dipto is a graduate of Mechanical Engineering at BUET. With over 1.5 years of experience at Exceldemy, he authored 70+ articles on ExcelDemy. He has expertise in designing worksheets at You’ve Got This Math. Currently, He is a Team Leader at Brainor. Dipto's passion extends to exploring various aspects of Excel. Beyond tech, he enjoys creating engaging kids' worksheets using Illustrator. A dedicated employee and innovative content developer, He incorporates a commitment to academic excellence and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF