  Hexagonal La$_2$Ni$_7$ and rhombohedral Y$_2$Ni$_7$ are weak itinerant
antiferromagnet (wAFM) and ferromagnet (wFM), respectively. The crystal
structure and magnetic properties of $A_2B_7$ intermetallic compounds ($A$ =
La, Y, $B$ = Ni) have been investigated combining X-ray powder diffraction and
magnetic measurements. The La$_{2-x}$Y$_x$Ni$_7$ intermetallic compounds with
$0 \leq x \leq 1$ crystallize in the Ce$_{2}$Ni$_7$-type hexagonal structure
with Y preferentially located in the [$AB_2$] units. The compounds with larger
Y content ($1.2 \leq x < 2$) crystallize in both hexagonal and rhombohedral
(Gd$_2$Co$_7$-type) structures with a progressive substitution of Y for La in
the $A$ sites belonging to the [$AB_5$] units. Y$_2$Ni$_7$ crystallizes in the
rhombohedral structure only. The average cell volume decreases linearly versus
Y content, whereas the c/a ratio presents a minimum at $x = 1$ due to geometric
constrains. The magnetic properties are strongly dependent on the structure
type and the Y content. La$_{2}$Ni$_7$ displays a complex metamagnetic behavior
with split AFM peaks. Compounds with x = 0.25 and 0.5 display a wAFM ground
state and two metamagnetic transitions, the first one towards an intermediate
wAFM state and the second one towards a FM state.T$_N$ and the second critical
field increase with the Y content, indicating a stabilization of the AFM state.
LaYNi$_7$, which is as the boundary between the two structure types, presents a
very wFM state at low field and an AFM state as the applied field increases.
All the compounds with $x > 1$ and containing a rhombohedral phase are wFM with
$T_C$ = 53(2) K. In addition to the experimental studies, first principles
calculations using spin polarization have been performed to interpret the
evolution of both structural phase stability and magnetic ordering for $0 \leq
x < 2$.
