Short answer, yes.
Excess cable length would be hanging past the derailleur pinch bolt. It sounds like you are talking about making the housing shorter. Specifically the housing closest to the shifter. Doing this will involve loosening the pinch bolt and pulling the cable all the way back to the shifter. Once the housing is chopped the process is going to be the same as installing a new shift cable. In fact using a new cable may be a good option. Once the cable is routed back to the derailleur and pinched, indexing the gears will be the last step.