ABSTRACT We use the voids-within-voids-within-voids (VVV) simulations, a suite of successive nested N-body simulations with extremely high resolution (denoted, from low to high resolution, by L0 to L7), to test the Press–Schechter (PS), Sheth–Tormen (ST), and extended Press–Schechter (EPS) formulae for the halo abundance over the entire mass range, from minihaloes of 10−6 M⊙, to cluster haloes of 1015 M⊙, at different redshifts, from z = 30 to the present. We find that at z = 0 and z = 2, ST best reproduces the results of L0, which has the mean cosmic density (overdensity δ = 0), at 1011−15 M⊙. The higher resolution levels (L1–L7) are biased underdense regions (δ < −0.6). The EPS formalism takes this into account since it gives the mass function of a region conditioned, in this case, on having a given underdensity. EPS provides good matches to these higher levels, with deviations ≲20 per cent, at 10−6−12.5 M⊙. At z ∼ 7−15, the ST predictions for L0 and the EPS for L1–L7 show somewhat larger deviations from the simulation results. However, at even higher redshifts, z ∼ 30, EPS fits the simulations well again. We confirm our results by picking more subvolumes from the L0 simulation, finding that our conclusions depend only weakly on the size and overdensity of the region. The good agreement of EPS with the higher level simulations implies that PS (or ST) gives an accurate description of the total halo mass function in representative regions of the universe.