The substitution of zinc for iron in YBaFe4O7 has allowed the oxide series YBaFe4-xZnxO7, with 0.40 < x < 1.50, belonging to the 114 structural family to be synthesized. These oxides crystallize in the hexagonal symmetry (P63mc), as opposed to the cubic symmetry (F-43m) of YBaFe4O7. Importantly, the d.c. magnetization shows that the zinc substitution induces ferrimagnetism, in contrast to the spin glass behaviour of YBaFe4O7. Moreover, a.c. susceptibility measurements demonstrate that concomitantly these oxides exhibit a spin glass or a cluster glass behaviour, which increases at the expense of ferrimagnetism, as the zinc content is increased. This competition between ferrimagnetism and magnetic frustration is interpreted in terms of lifting of the geometric frustration, inducing the magnetic ordering, and of cationic disordering, which favours the glassy state.