We present a detailed study of a continuum random-phase approximation approach to quasielastic electronnucleus and neutrino-nucleus scattering. We compare the (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. We find an overall satisfactory description of the (e,e ) data. Further, we study the 12 C(ν μ ,μ − ) 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.