Most schemes for determining the mass function of virialized objects from the statistics of the initial density perturbation field suffer from the «cloud-in-cloud» problem of miscounting the number of low-mass clumps, many of which would have been subsumed into larger objects. We propose a solution based on the theory of the excursion sets of F(r, R f ), the four-dimensional initial density perturbation field smoothed with a continuous hierarchy of filters of radii Rf. We identify the mass fraction of matter in virialized objects with mass greater than M with the fraction of space in which the initial density contrast lies above a critical overdensity when smoothed on some filter of radius greater than or equal to R f (M).