Difference between $x$ and $X$
Formulas can be checked against infinite online resources, not here.  

The most widespread use of $x$ and $X$ to distinguish something, is when it is needed to emphasize what is treated in theoretical derivations as a realized value (a fixed number, $x$), and what as a random variable, $X$. When using matrix algebra though bold uppercase denotes a matrix (but in panel data where everything is a matrix, we see often simple uppercase to denote a matrix).

Sometimes, authors don't bother, since it should be obvious from context.

Perhaps the most usual confounding is to use lowercase $x$ for either a realized value or a random variable, but use uppercase letters for random variables.  

As for calculation, it is always done using data, so there is nothing to "convert" here. If you have the realized data on $X$ and $Y$, then plug them in the formula. 

Any other contrasting use of the two is of course not "forbidden", but then one should read carefully how each author defines their use. Nevertheless, to use simply $x$ to denote "a variable centered on its sample mean" $x=X-\bar X$, is rather unusual and confusing I would say, and in any case it does not warrant a change from lowercase to uppercase. We usually write things like

$$x^* \equiv x-\bar x$$

or some other symbol instead of a star.