A comprehensive study of the total energy of manganese-rich Heusler compounds using density functional theory is presented. Starting from a large set of cubic parent systems, the response to tetragonal distortions is studied in detail. We single out the systems that remain cubic from those that most likely become tetragonal. The driving force of the tetragonal distortion and its effect on the magnetic properties, especially where they deviate from the Slater--Pauling rule, as well as the trends in the Curie temperatures, are highlighted. By means of partial densities of states, the electronic structural changes reveal the microscopic origin of the observed trends. We focus our attention on the magnetocrystalline anisotropy and find astonishingly high values for tetragonal Heusler compounds containing heavy transition metals accompanied by low magnetic moments, which indicates that these materials are promising candidates for spin-transfer torque magnetization-switching applications.