The correlation coefficient $r_{xy}$ for two variables $x$ and $y$ is given by

and $s_{xy}$ is the covariance given by $s_{xy} = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{n-1}$ and $s_x$ and $s_y$ are the standard deviations of $x$ and $y$, respectively.

In Excel, use the CORREL function, where $x$ and $y$ are two ranges:

=CORREL(x,y)

Demo