  For each nonempty integer partition $\pi$, we define the maximal excludant of
$\pi$ to be the largest nonnegative integer smaller than the largest part of
$\pi$ that is not a part of $\pi$. Let $\sigma\!\operatorname{maex}(n)$ be the
sum of maximal excludants over all partitions of $n$. We show that the
generating function of $\sigma\!\operatorname{maex}(n)$ is closely related to a
mock theta function studied by Andrews \textit{et al.} and Cohen. Further, we
show that, as $n\to \infty$, $\sigma\!\operatorname{maex}(n)$ is asymptotic to
the sum of largest parts of all partitions of $n$. Finally, the expectation of
the difference of the largest part and the maximal excludant over all
partitions of $n$ is shown to converge to $1$ as $n\to \infty$.
