For example, if we have the following random variables:
$Y\sim Bern\left(\frac{1}{5}\right),$ $ Z = \left\{ \begin{array}{l l} X & \quad \text{Y=1}\\ -4X & \quad \text{Y=0} \end{array} \right.$
(where $X$ is another random variable)
And I want to find $E\left(Z\middle| Y\right)$. The solution my course sheets give is: $E\left(Z\middle| Y\right)=\sum_y\left(Z=z\middle|Y=y\right) \cdot P(Y=y)=X\cdot\frac{1}{5}-4X\cdot\frac{4}{5}$ but according to the formal definition of conditional expectation, the sum should be done over values of $z$ and not $y$. This solution seems to be finding $E(Z)$ and not $E(Z|Y)$.
Calculating $E(Z|Y=0)$ or $E(Z|Y=1)$ is easy, because once the value of $Y$ is known then the value of $Z$ is known immediately.
But how can I solve $E(Z|Y)$ without a specific value being given for $Y$? More generally, how do I interpret conditional expectation when the conditional value isn't given?