Since the molecules that absorb visible or near infrared light cause electron excitation, analysis on electronic states leads to the development of new derivatives. Our target compounds are nitrogen-containing polyheterocyclic ones with various absorption wavelengths (the blue and near infrared absorptions). We investigated the relationship between the structures and the absorption wavelengths of these compounds using quantum chemical calculation. As a result, it was confirmed that similar electron excitation occurs in all the structures. Furthermore, when comparing the experimental and calculated excitation energies, the compounds can be divided into two group. One group overestimates the excitation energy and the other shows close estimation to the experimental measurement values. However, even in the overestimated groups, we found the linearity between calculated and experimental energies in most substituents. Thus, since this method is considered to be sufficient to design novel molecular structures by quantum chemistry calculations among structures with small differences in the geometries, further discovery of structure can be expected.