Higher-mode contribution is important in surface-wave inversion because it allows more information to be exploited, increases investigation depth, and improves model resolution. A new misfit function for multimodal inversion of surface waves, based on the Haskell-Thomson matrix method, allows higher modes to be taken into account without the need to associate experimental data points to a specific mode, thus avoiding mode-misidentification errors in the retrieved velocity profiles. Computing cost is reduced by avoiding the need for calculating synthetic apparent or modal dispersion curves. Based on several synthetic and real examples with inversion results from the classical and the proposed methods, we find that correct velocity models can be retrieved through the multimodal inversion when higher modes are superimposed in the apparent dispersion-curve or when it is not trivial to determine a priori to which mode each data point of the experimental dispersion curve belongs. The main drawback of the method is related to the presence of several local minima in the misfit function. This feature makes the choice of a consistent initial model very important.