We have developed a universal method to form the reference signal for the stabilization of arbitrary atomic clocks based on Ramsey spectroscopy. Our approach uses an interrogation scheme of the atomic system with two different Ramsey periods and a specially constructed combined error signal (CES) computed by subtracting two error signals with the appropriate calibration factor. CES spectroscopy allows for perfect elimination of probe-induced light shifts and does not suffer from the effects of relaxation, time-dependent pulse fluctuations and phase-jump modulation errors and other imperfections of the interrogation procedure. The method is simpler than recently developed auto-balanced Ramsey spectroscopy techniques (Sanner et al 2018 Phys. Rev. Lett. 120 053602; Yudin et al 2018 Phys. Rev. Appl. 9 054034), because it uses a single error signal that feeds back on the clock frequency. The use of CES is a general technique that can be applied to many applications of precision spectroscopy.