Kohn-Sham formalism for the treatment of excited states within the den
sity-functional theory (DFT) is presented. DFT exchange and correlatio
n energy functionals for excited states are defined. Explicit expressi
ons for these functionals are derived by generalizing a recent DFT per
turbation theory. A computational scheme for the treatment of excited
states within the DFT is suggested. Differences of Kohn-Sham eigenvalu
es are shown to be well-defined approximations for excitation energies
. Correction terms to these approximations are presented. Perturbation
theory expansions for band gaps are discussed.