It is well believed that the volumetric entropy of Edwards captures part of the physics of granular media, but it is still unclear whether it can be applied to granular systems under mechanical stress. By working out a recent proposal by Aste, Di Matteo *et al.* to measure Edwards' compactivity from the volume distribution of Voronoï or Delaunay tessellations (*Phys. Rev. E*, **77** (2008) 021309), and assuming that the total volume divides into elementary cells of fixed minimal volume, we derive an equation of state relating the compactivity to the packing fraction, and we show by extensive molecular-dynamics simulations that this equation and its underlying assumption describe well the volumetric aspects of both the limit state of isotropic compression and the limit state of shear (also called *critical state* in soil mechanics) for three-dimensional ensembles of mono-disperse spheres, for a broad range of the sliding and rolling friction coefficients. In addition, by using the limit state of isotropic compression as testing ground, we find that the compactivity, the entropy per elementary cell and the number of elementary cells per grain computed by this method are the same within statistical precision, either by using Voronoï, Delaunay, or centroidal Voronoï tessellations, allowing thus for an objective definition. This means that not only Aste's cell method is robust and suitable to measure Edwards' compactivity of granular systems under mechanical stress but also the actual nature of the elementary cells might be unimportant.