A new study found that magnesium can help people get the most out of their vitamin D. Published in The American Journal of Clinical Nutrition, the study found that magnesium not only helped people absorb vitamin D and raise levels, but it also reduced levels in study participants whose vitamin D was too high.

Vitamin D’s health benefits have been widely documented—it helps reduce inflammation, improve bone health and enhance immune function, and it’s linked to a lower risk of certain cancers and chronic diseases—yet estimates say roughly 42 percent of Americans are deficient.

Although we can get vitamin D from sunlight and food, if you live north of the line that runs from Los Angeles across to the northern border of Florida, you probably aren’t getting enough sunlight most months of the year to keep your vitamin D on track. That makes supplementation a good bet. The daily recommendation for adults is 400–800 IUs or 10–20 mcg daily. Here’s the catch: If your magnesium levels are low, your body might not be absorbing the vitamin D you ingest. The study therefore suggests that taking your daily allowance of magnesium can help you maintain optimal levels of vitamin D.

Magnesium is associated with muscle and nerve function, blood glucose levels and blood pressure, and protein synthesis. It also helps bones develop properly. It is estimated that as many as 80 percent of Americans are deficient. Magnesium can be found in leafy greens, legumes, whole grains, nuts and seeds. The recommended daily dose is 420 mg for men older than 31, 400 mg for men younger than 31. Women older than 19 should take 320 mg.