In this paper we prove new relations between the comparative index and the Hömander index (and the Maslov index) in the finite dimensional case. As a main result we derive an algebraic formula for calculating the Hörmander index of four given Lagrangian planes as a difference of two comparative indices involving certain transformed Lagrangian planes, or as a combination of four comparative indices. This result is based on a generalization of the comparison theorem for the Maslov index involving three Lagrangian paths. In this way we contribute to the recent efforts in the literature (by Zhou, Wu, Zhu in 2018 and by Howard in 2021) devoted to an efficient calculation of the Hörmander index in this finite dimensional case.