We investigate the validity of the Press-Schechter formalism for calculating the mass distribution function, f(M), of the bound objects which condense out of a primordial density perturbation field. We give a revised analysis, which automatically has the correct normalization and accounts explicitly for the mass in underdense regions. The resulting f(M) depends on the form of the filter function chosen; in general this method predicts more low-mass objects than the Press-Schechter formalism. We also consider the effects of identifying density maxima as the sites of proto-objects. This predicts an f(M) with a different shape, but again with a low-mass power-law tail which lies above the Press-Schechter result, unless a very large mass is assigned to each peak. Our method allows additional constraints to be added to govern the formation of certain classes of object. As an illustration, we calculate a mass function for galaxies, using the criterion that an object must have been able to cool in the time between its collapse epoch and the present. This produces a mass-dependent overdensity threshold which can reduce the relative abundance of low-mass objects considerably, providing a qualitative explanation for the form of the galaxy luminosity function. © Royal Astronomical Society.