The real spherical harmonics can be written in terms of the complex spherical harmonics:
$$ Y_{\ell m} = \begin{cases} \displaystyle \sqrt{2} \, (-1)^m \, \operatorname{Im}[{Y_\ell^{|m|}}] & \text{if}\ m<0\\ \displaystyle Y_\ell^0 & \text{if}\ m=0\\ \displaystyle \sqrt{2} \, (-1)^m \, \operatorname{Re}[{Y_\ell^m}] & \text{if}\ m>0. \end{cases} $$
Where does the factor of $\sqrt{2}$ come from?
Actually, it's also not clear to me where the $(-1)^m$ comes from either, though I can believe that's related to the Condon-Shortley phase. Is there an intuitive explanation for how the real and complex spherical harmonics are related?
I have seen them written (equivalently) in the form (given by this wiki page) as
$$ Y_{lm} = \begin{cases} \frac{1}{\sqrt{2}} ( Y_l^m + (-1)^mY_l^{-m} ) & \text{if } m > 0 \\ Y_l^m & \text{if } m = 0 \\ \frac{1}{i \sqrt{2}}( Y_l^{-m} - (-1)^mY_l^m) & \text{if } m < 0 \end{cases} $$ Now, Wikipedia page says (quote) "The harmonics with $m > 0$ are said to be of cosine type, and those with $m < 0$ of sine type." The relationship between the complex exponential functions $\{e^{imx}\colon m\in \mathbb Z\}$ and the trigonometric functions being $$\cos mx=\frac{e^{imx}+e^{-imx}}{2}$$ and $$\sin mx=\frac{e^{imx}-e^{-imx}}{2i}$$
It's clear that the relationship between your written version and mine is that I have explicitly expressed the real and imaginary parts.