First-principles calculations of electronic excitations in clusters