Scott Markewitz/Getty

This article was originally published on Business Insider Deutschland.

It's clear exercise has health benefits both physical and mental.

But what if we could prove it has more of an impact on your mental health than your economic status?

Well, researchers at Yale and Oxford may have done so.

In a study published in The Lancet, scientists collected data about the physical behavior and mental mood of over 1.2 million Americans.

Participants were asked to answer the following question: "How many times have you felt mentally unwell in the past 30 days, for example, due to stress, depression, or emotional problems?"

The participants were also asked about their income and physical activities. They were able to choose from 75 types of physical activity — from mowing the lawn, taking care of children, and doing housework to weight lifting, cycling, and running.

People who stay active tend to be happier.

The scientists found that while those who exercised regularly tended to feel bad for 35 days a year, nonactive participants felt bad for 18 days more, on average.

In addition, the researchers found that physically active people feel just as good as those who don't do sports but who earn about $25,000 more a year. Essentially, you'd have to earn a lot more to get you the same happiness-boosting effect that sport has.

But it doesn't mean the more sport you do the happier you are.

Too much exercise can be detrimental to your mental health

Exercise is clearly good for you, but how much is too much?

"The relationship between sport duration and mental load is U-shaped," said study author Adam Chekroud of Yale University in an interview with Die Welt.

The study found that physical activity contributes to better mental well-being only when it falls within a certain time frame.

According to the study, three to five training sessions, each lasting between 30 to 60 minutes, are ideal per week.

The mental health of those participants who exercised for longer than three hours a day suffered more than that of those who weren't particularly physically active.

The scientists also noticed that certain sports that involve socializing — such as team sports — can have more of a positive effect on your mental health than others.

Despite the fact that neither cycling nor aerobics and fitness technically counts as team sports, these activities can also have a considerable positive effect on your mental health.