How to Calculate Covariance?

Calculating covariance is mainly used in stocks. Are you plaining on buying some stocks. if so you will be surpised to know that calculation the covariance of two stocks is the first step when calcultin correlation.