Electronic states of valence-skipping compounds