  We present a detailed study of a continuum random phase approximation
approach to quasielastic electron-nucleus and neutrino-nucleus scattering. The
formalism is validated by confronting ($e,e'$) cross-section predictions with
electron scattering data for the nuclear targets $^{12}$C, $^{16}$O, and
$^{40}$Ca, in the kinematic region where quasielastic scattering is expected to
dominate. We examine the longitudinal and transverse contributions to
$^{12}$C($e,e'$) and compare them with the available data. Further, we study
the $^{12}$C($\nu_{\mu},\mu^{-}$) cross sections relevant for accelerator-based
neutrino-oscillation experiments. We pay special attention to low-energy
excitations which can account for non-negligible contributions in measurements,
and require a beyond-Fermi-gas formalism.
