Magnetic properties of the R2Fe17 compounds are sensitive to the atomic substitutions and interstitial absorption of nitrogen. In our work, both were combined and their effect on the magnetization behavior of Er2Fe17 compound in magnetic fields up to 58 T was studied. Er2Fe17N2, Sm1.2Er0.8Fe17N2 and Sm1.8Er0.2Fe17N2.1 nitrides were prepared. Magnetization measurements were carried out, mainly on powder samples (excluding Er2Fe17 single crystal). Nanopowders of Sm1.2Er0.8Fe17N2 were obtained by mechanical grinding. The grinding time was varied from 0 to 60 minutes. The strength of the inter-sublattice coupling in samples is estimated by analyzing high-field magnetization data.