The local atomic structure in the amorphous Al x ͑Cu 0.4 Y 0.6 ͒ 100Ϫx and Mg x ͑Cu 0.4 Y 0.6 ͒ 100Ϫx ͑0рxр85͒ alloys was determined by neutron-diffraction experiments. The electronic structure near the Fermi level was determined using the same samples by means of x-ray photoemission spectroscopy and soft x-ray spectroscopy. Both sets of data are combined to determine self-consistently and uniquely the local atomic structure in both Al-and Mg-based amorphous alloys. The bonding nature and resulting atomic environment are found to depend significantly on whether the third element is Al or Mg. Based on the atomic and electronic structures thus derived, we could interpret the Al or Mg concentration dependence of the crystallization temperature, electronic specific-heat coefficient, and also that of the resistivity value of 300 K. The origin of the appearance of a positive Hall coefficient observed in the Al-based amorphous alloys but not in the Mg-based amorphous alloys is also briefly discussed.