Let $P$ be the set of permutations of $1234$. Let $P_i$ be the subset
of permutations that fix $i$, and put $P_{ij}=P_i\cap P_j$ and so on.
Let $D$ be the set of derangements, or in other words permutations that
do not fix anything, so
$$ D = P \setminus (P_1\cup P_2\cup P_3\cup P_4). $$
The inclusion-exclusion principle says that
\begin{align*} |D| =& |P| - (|P_1| + |P_2| + |P_3| + |P_4|) +
(|P_{12}| + |P_{13}| + |P_{14}| + |P_{23}| + |P_{24}| + |P_{34}|) \\
& - (|P_{123}| + |P_{124}| + |P_{134}| + |P_{234}|) + |P_{1234}|.
\end{align*}
$$ |D| = 24 - (6+6+6+6) + (2+2+2+2+2+2) -(1+1+1+1)+1 = 9. $$