Magnesium is important for the conversion of many B vitamins into their active form. In other words, taking any vitamin supplement on its own would be futile without magnesium and other minerals as their interplay is what makes the brain work. One study found that administration of magnesium supplements to aged rats improved working and long-term memory. The magnesium in cell membranes is also important for the transmission of impulses. Furthermore, magnesium and calcium need to be both in ideal amounts in the body to prevent excitability of the nervous system. A deficiency of either one can lead to neurological problems.