The recently proposed CASΠDFT method combines the reliable description of nondynamic electron correlation with the complete active space (CAS) wavefunction and the efficient treatment of dynamic correlation by density functional theory (DFT). This marriage is accomplished by adopting the DFT correlation energy functional modified with the local correction function of the on-top pair density (Π). The role of the correction function is to sensitize the correlation functional to local effects of suppression and enhancement of dynamic correlation and to account for an adequate amount of dynamic correlation energy. In this work we show that the presence of covalent and ionic configurations in a wavefunction gives rise to spatial regions where the effects of suppression and enhancement of correlation energy, respectively, dominate. The results obtained for the potential energy curves of the excited states of the hydrogen molecule prove that CASΠDFT is reliable for states that change their character along the dissociation curve. The method is also applied to the lowest excited states of six-membered heterocyclic nitrogen compounds such as pyridine, pyrazine, pyrimidine, and pyridazine. The obtained excitation energies for the n → π* and π → π* excitations confirm the good performance of CASΠDFT for excited states. The absolute average error of the method is 0.1 eV lower than that of the CCSD method and higher by the same amount than that of the more expansive CC3 variant. Compared with the coupled cluster methods, this encouraging performance of CASΠDFT is achieved at the negligible computational cost of obtaining the correlation energy.