The effect of Ga substitution for Fe in R2Fe17 (R=Y, Sm, Gd, Tb, Dy, Ho, Er, and Tm) compounds on the structure and magnetocrystalline anisotropy has been studied by means of x‐ray diffraction and magnetization measurements. Both iron sublattice anisotropy and rare earth sublattice anisotropy are found to be modified by the introduction of the gallium atoms. A uniaxial anisotropy is shown in R2Fe17−xGax (for R=Y, Gd, Tb, Dy, Ho, Er, and Tm) compounds with high Ga concentration, whereas a reversal change in the easy magnetization direction is observed in the samples for R=Sm. The contributions to the uniaxial orientation of the magnetization in these compounds result from not only the rare earth sublattice, but also the iron sublattice. © 1995 American Institute of Physics.