Excited state formation as a function of initial energy of H+ and He+ ions scattered from metal surfaces