We already know that sitting all day can lead to adverse health consequences — from bad posture to a shorter lifespan. But research out there also advises against standing all day, which makes working at an office quite difficult as you can’t always have walking meetings or fill in spreadsheets in the park.

There’s a way to find a balance, however, according to Alan Hedge, a professor of ergonomics at Cornell University. Hedge believes that mixing up your daily schedule with both sitting and standing — shaking things up every half hour — is the healthiest way to work.

“The key is breaking up your activity throughout the day,” Hedge told the Wall Street Journal. “Sitting all day and standing all day are both bad for you.”

The trick is to sit for 20 minutes, stand for eight, then move around and stretch for two minutes. Even if you work out in the morning before work, it’s probably not enough to stave off the health risks of sitting for eight hours; so making sure you can stand and walk during work hours is important.

“The current scientific evidence shows that when people have occupations in which they are on their feet for more than two hours a day, there seems to be a reduction in the risk of developing key chronic diseases,” John Buckley, professor of applied exercise science at the University of Chester in England and the author of a report about reducing sedentary lifestyles, told the Wall Street Journal.

Hedge and Buckley both worked on the report, which was published in the British Journal of Sports Medicine and listed a set of guidelines to help employers boost physical activity and decrease sitting time among their employees.

Workers who primarily sit at a desk all day “should aim to initially progress toward accumulating two hours/day of standing and light activity (light walking) during working hours,” the authors wrote, “eventually progressing to a total accumulation of four hours/day.”

They continued: “To achieve this, seated-based work should be regularly broken up with standing-based work, the use of sit-stand desks, or the taking of short active standing breaks. … [C]ompanies should also promote among their staff that prolonged sitting, aggregated from work and in leisure time, may significantly and independently increase the risk of cardiometabolic diseases and premature mortality.”

If you don’t have access to a standing desk, get up every 20 minutes to take a short walk through the office, walk up some stairs, or go outside for a brief stroll. If you don’t drive, stand on public transportation rather than sit. And take an hour every day before or after work to get aerobic physical activity in.

Source: Buckley J, Hedge A, Yates T, Copeland R, Loosemore M, Hamer M. The sedentary office: a growing case for change towards better health and productivity. British Journal of Sports Medicine. 2015.