Local Virial Theorem for Ensembles of Excited States*