A test is performed on the validity of a recently proposed formalism for quantitative surface analysis by electron spectroscopy. To this end, four samples were produced with identical amounts of gold within the surface region of a Ni sample but with different in-depth distributions. These samples were analyzed by XPS without making any assumptions about the actual gold in-depth profile. The formalism is found to improve quantification of the total amount of gold within the surface region of the inhomogeneous samples by more than one order of magnitude when compared to traditional analysis. In sets of spectra where the measured peak intensity (determined by the Shirley method) varied by factors of 1.79, 3.23, and 33, the error in the quantitative analysis by the present formalism was less-than-or-similar-to 4%, less-than-or-similar-to 7%, and less-than-or-similar-to 23%, respectively. The formalism also gives information on the in-depth concentration profile.