When the multiplicities of particles produced in heavy-ion collisions are fitted to the hadron-resonancegas model, excluded-volume effects play a significant role. In this work, we study the impact of such effects on the equation of state of pure Yang-Mills theory at low temperatures, comparing the predictions of the statistical model with lattice results. In particular, we present a detailed analysis of the SU(2) and SU(3) Yang-Mills theories: we find that, for both of them, the best fits to the equilibrium thermodynamic quantities are obtained when one assumes that the volume of different glueball states is inversely proportional to their mass. The implications of these findings for QCD are discussed.