The electronic states of atoms in a molecule are decisive for the coordination into specific crystalline structures. However, most of the commonly available analytical techniques cannot probe exactly both structural and spectroscopic properties simultaneously. As a result, a combination of analytical tools is required for the comprehensive characterization of compound of interest. Additionally, this limitation hinders the analysis of complex mixed-valence compounds, in which the weighted-average charge distribution may not reflect correctly the local chemical state of an atom associated with a specific atomic site of the structure. A solution is offered through the application of anomalous diffraction, from which the dispersion effect on the atomic scattering factor of the resonant atom can be measured. The dispersion effect correlates to the chemical state of the resonant atom, and hence, this technique allows to probe structural and spectroscopic properties using a single analytical technique.