On the basis of the Bogoliubov-de Gennes theory we study the transformation of the quasiparticle spectrum in the mixed state of a mesoscopic superconductor, governed by an external magnetic field. We analyze the low-energy part of the excitation spectrum and investigate the field dependent behavior of anomalous spectral branches crossing the Fermi level. Generalizing the Caroli-de Gennes-Matricon approach, we present an analytical solution describing the anomalous branches in a vortex with an arbitrary winding number. We also study the spectrum transformation caused by the splitting of a multiquantum vortex into a set of well separated vortices focusing mainly on a generic example of a two-vortex system. For vortices positioned rather close to the sample surface we investigate the effect of the quasiparticle reflection at the boundary on the spectrum and the density of states at the Fermi level. Considering an arbitrary surface curvature, we study the disappearance of an anomalous spectral branch for a vortex leaving the sample. The changes in the vortex configuration and resulting transformation of the anomalous branches are shown to affect strongly the density of states and the heat conductance along the magnetic-field direction.