The modern theory of polarization establishes the bulk-boundary correspondence for the bulk polarization. In this paper, we attempt to extend it to a sum rule of the bulk quadrupole moment by employing a many-body operator introduced in Kang et al. [B. Kang, K. Shiozaki, and G. Y. Cho, Phys. Rev. B 100, 245134 (2019)10.1103/PhysRevB.100.245134] and Wheeler et al. [W. A. Wheeler, L. K. Wagner, and T. L. Hughes, Phys. Rev. B 100, 245135 (2019)10.1103/PhysRevB.100.245135]. The sum rule that we propose consists of the alternating sum of four observables, which are the phase factors of the many-body operator in different boundary conditions. We demonstrate its validity through extensive numerical computations for various noninteracting tight-binding models. We also observe that individual terms in the sum rule correspond to the bulk quadrupole moment, the edge-localized polarizations, and the corner charge in the thermodynamic limit on some models.