Sm2Fe17 has long been known as a potential high-performance magnet whose deficiencies—planar anisotropy and lower-than-optimal Tc—can be remedied by nitrogen addition, but which presents synthesis difficulties. Herein we apply first-principles calculations to search for alternative low-cost, high-performance permanent magnets in this family, by exploring simultaneous Fe and Al substitution. Specifically, the goal is to improve properties of Sm2Fe14Al3 easy-plane magnet at the stoichiometric composition. Density functional theory calculations were executed for three series of compounds, i.e., Sm2(Fe1−xCox)14Al3, Sm2(Fe1−xCox)15Al2, and Sm2(Fe1−xCox)16Al. We find that substitution of Fe with 12–18 of Co in %Sm2Fe14Al3 modifies the magnetic anisotropy type from easy plane to easy axis with a substantial anisotropy of 7.1 MJ/m3. We also demonstrate that the largest part of magnetic anisotropy is introduced by 4f Sm atom electrons. Thus the rotation of magnetic moment orientation from ⟨1¯10⟩ to ⟨111⟩ is followed by an increase of the occupied 4f state number and, as a result, the orbital part of the magnetic moment of one of the Sm atoms. This increase of the occupied 4f state number at an energy ∼−4.3 eV results in a significant reduction of band structure energy. The substitution of Fe by Co does not significantly reduce the magnetization of the compound and keeps it slightly above 1 T. This combination of magnetic anisotropy and magnetization makes the compound a promising candidate for a permanent magnet.