A new review published Wednesday in The Lancet reveals that sitting too long may not always be bad for our health as long as we get enough exercise elsewhere.

The findings showed that people who exercised moderately an hour or more a day — such as walking a mile in 17 minutes — were the least likely to die during the length of time they were being observed, even if they sat at a desk for up to eight hours a day. Even lighter exercise while being sedentary weakened mortality risk compared to people who barely stayed active. However, the relationship between watching television and an early grave was harder to wipe away through hitting the gym alone. People who watched five hours or more a day still had an increased mortality risk compared to those who watched less, even when they regularly exercised.

Scientists closely studied the available research on the connections between daily physical activity, sedentary behavior, and premature death. After analyzing 16 long-term studies that included more than a million volunteers, they shuffled the participants into one of four main groups, depending on how much exercise and sedentary behavior they engaged in every day.

“There has been a lot of concern about the health risks associated with today’s more sedentary lifestyles,” said lead author Ulf Ekelund, a professor at the Norwegian School of Sports Sciences as well as the UK’s University of Cambridge, in a statement. “Our message is a positive one: it is possible to reduce – or even eliminate – these risks if we are active enough, even without having to take up sports or go to the gym.”

Previous research on the topic has been mixed, with some studies finding that exercise doesn’t cancel out the dangers of sedentary behavior, which can include poorer heart health and an increased risk of cancer, and other studies finding the opposite. According to the authors, their study addresses a weakness of these earlier attempts by simultaneously matching up people’s level of physical activity and sedentary behavior to their risk of dying.

In-depth and encouraging as the findings are, however, it’s not all good news. For one, the studies collected by the researchers mostly looked at people over the age of 45 who lived in the U.S., Western Europe, and Australia, meaning their findings may not be universal.

Secondly, when the researchers conducted a smaller analysis of people’s TV watching time, they found TV watching was more deadly than sedentary behavior in general. This might be because the habit specifically encourages other unhealthy behaviors like eating junk food, or because people are less likely to take breaks to move around while watching a show as opposed to working at a desk.

According to another study recently published by The Lancet, as part of its research series on physical activity, the health costs of sedentary behavior amounted to $53.8 billion worldwide in 2013. Given that high and at least partly preventable sticker price, Ekelund and his colleagues hope their findings can encourage people to exercise more often, in whatever way they can.

“For many people who commute to work and have office-based jobs, there is no way to escape sitting for prolonged periods of time. For these people in particular, we cannot stress enough the importance of getting exercise, whether it’s getting out for a walk at lunchtime, going for a run in the morning or cycling to work,” he said. “An hour of physical activity per day is the ideal, but if this is unmanageable, then at least doing some exercise each day can help reduce the risk.”

Source: Ekelund U, Steene-Johannessen J, Brown W, et al. Does Physical Activity Attenuate, Or Even Eliminate, The Detrimental Association Of Sitting Time With Mortality? A Harmonised Meta-Analysis Of Data From More Than 1 million Men And Women. The Lancet. 2016.