Pie chart for beta calculation shows the amount of percent allocated to covariance value and variance value.

Some stocks can have negative beta value that is mostly relied on the market value.
― Note

Beta is used to measure the endowment of an investment relative to the market portfolio that was not helpful when considering diversification.

Market beta

For example, calculating beta of some organization (A) as compared to some stock market index tracking the performance of organizations (B). The correlation between (A) and (B) is 0.99. If (A) has a std (standard deviation) of returns as 15.55% and if (B) has a std of returns of 15.55%. Then the beta for organization (A) is (correlation * ( (15.55/100) / (15.55/100) ) ) that is 0.999

The most handy formula to calculate the beta of some company is to divide covariance by variance.