The compounds of Gd2(Fe1-xCox)15Ga2(0≤x≤1.0) and Gd2(Fe0.8Co0.2)17-yGay(0≤y≤8) were prepared by arc melting. Their structure and magnetic properties have been studied by means of X ray diffraction and magnetic measurements. Experimental results show that single phase compounds with the 2∶17-type structure were obtained for all samples. It was found that the unit cell volume of Gd2(Fe1-xCox)15Ga2 compounds decreases, while the Curie temperature Tc increases monotonously with increasing Co concentration. The saturation magnetization Ms at 1.5K first increases with increasing x, then decreases, showing a value of maximum at x=0.2. For Gd2(Fe0.8Co0.2)17-yGay,the unit cell volume increases, the Curie temperature and the saturation magnetization at 1.5K decrease monotonously with increasing Ga content. The substitution of Co or Ga for Fe in Gd2Fe17 compounds results in a change of magnetocrystalline anisotropy of Fe or Co sublattice from easy plane to easy c-axis at room temperature. This is likely related to the preferential site occupancy of Ga atom.