  We critically discuss the problem of finding the $\lambda$-index
$\mathcal{N}(\lambda)\in [0,1,\ldots,N]$ of a real symmetric matrix
$\mathbf{M}$, defined as the number of eigenvalues smaller than $\lambda$,
using the entries of $\mathbf{M}$ as only input. We show that a widely used
formula $$ \mathcal{N}(\lambda)=\lim_{\epsilon\to 0^+}\frac{1}{2\pi
\mathrm{i}}\left[\log\det(\mathbf{M}-\lambda+\mathrm{i}\epsilon)-\log\det(\mathbf{M}-\lambda-\mathrm{i}\epsilon)\right]
$$ based on the branch-cut structure of the complex logarithm should be handled
with care, as it generically fails to produce the correct result if the same
branch is chosen for the two logarithms.
  We improve the formula using multidimensional Fresnel integrals, showing that
even the new version provides at most a self-consistency equation for
$\mathcal{N}(\lambda)$, whose solution is not guaranteed to be unique. Our
results are corroborated by explicit examples and numerical evaluations.
