We found that in A2V13O22 (A=Ba, Sr), which contains a trilayer slab of VO in the sodium-chloride structure with periodically missing ions, the trimerization of V ions occurs at 290 K (A=Ba) and 380 K (A=Sr). V trimers form a three-dimensional network, but some V ions remain untrimerized in these compounds. The suppression of magnetic susceptibility with trimerization and the existence of a Curie tail at low temperatures, together with the result of NMR measurement, indicate that the V trimers are spin singlet, whereas the untrimerized V ions have a magnetic moment; i.e., there is a spontaneous separation between nonmagnetic and magnetic ions in the crystal.