In several more complex atoms the magnetic effect is not cancelled out within the atom. This is the case with many metals. However, when the atoms are grouped together many billions of times over the tiny magnets produced from the dipoles line up in a random manner producing no overall magnetic field. This is because the atomic structure for most metals locks each molecule in place in a random manner.