Energy band structure and density of states of the compound Y(Co,Fe)5 were obtained by the augmented spherical wave method. Also the localization of the magnetic moment inside the unit cell, the effect of pressure and the substitution of Co atoms by Fe atoms were studied at the temperature of 0 K. Metallic Co showed a magnetic moment of 1.5 B while metallic Y showed its non magnetic behavior. Inside the compound YCo5 the Y atom had a contribution of –0.3 B to the total magnetization of the unit cell. A negative pressure caused the change of the Fermi energy and the modification of the magnetic moment. With a big enough positive pressure the total magnetic moment dropped to zero. The substitution of Co by Fe caused a change in the compound from strong ferromagnetic to soft ferromagnetic.