In R-Fe compounds, the magnetic properties are mainly determined by the Fe-Fe interatomic distances and the number of Fe nearest neighbors. Below the ordering temperatures, the R2Fe17compounds are generally ferromagnetic or ferrimagnetic colinear. The compounds with rare earth ions of small atomic radii, Ce2Fe17, Tm2Fe17, and Lu2Fe17, are exceptions; they are helimagnetic. At low temperatures they exhibit a transition either to a fan spin or to a ferrimagnetic colinear configuration. For all compounds, a negative thermal expansion is observed below their ordering temperatures. Negative interactions occuring mainly in the substitution zones are thus deduced. Varying strongly with distances, they lead to the observed anomalous thermal expansion, and being largest in the compounds with the shortest Fe-Fe distances, their helimagnetic structure is explained.