Making duty rosters on Excel is time consuming, requires juggling of complex rules and trying to be fair to everyone. And if you make one tiny mistake? People get mad at you, even when you’ve done your best.
We’ve seen many doctors (usually associate consultants) and nurses (usually ward managers) spend hours trying to make a roster on Excel, usually manually brute-forcing combinations until it works.
But it is time-consuming, prone to human errors, not flexible to ad-hoc workforce changes, and if at any point, you realize it wouldn’t work, you will have to scrape it entirely and start again with a different combination.
“Shouldn’t there be an easier way for doctors to make duty rosters?”
We couldn’t find one, so eventually we built it ourselves.
In this article, we’ll share the story of how and why we created 8 Hours.
How We Discovered This Problem
A few years back, Dr Ma, who was by then an associate consultant for the Paediatrics Department of AHNH, complained to me that he’s been put in charge of making duty rosters for his department.
It was taking him hours of time, and mentally exhaustive. Plus, people would complain if the roster seems unfair to any one of them — despite his best try at making one.
This was his greatest administrative pain in his career.
And thus, he started to explain why it is difficult to make rosters.
Problem #1: Scalability
It is easy to make a roster for any team at the size of, say, 6-7 people. However, as the size of your team grow, the roster quickly becomes out of scale.
For the case of Dr Ma, he is in charge of the scheduling for 30+ people, over 5 seniorities, from interns, 1st call, 2nd call, 3rd call, to consultant calls.
Even with simple rules, the sheer size of the problem has quickly become overwhelming. Because for every new member you add, your roster is 10x harder than before, which snowballs into a gigantic problem.
Problem #2: Complex Rules
There are bound to be rules for each ward to make sure things are fair. However, some wards have ultra specific rules that needs attention.
For example, Dr Ma’s ward required some people to oversee both 1st call and 2nd call duties, as their skill levels progress. Importantly, you cannot schedule any 2 of these people on the same day, because that would cause them to not be able to help one another out.
It’s very tiresome to juggle with all these rules around, but you must stay diligent, for if you unknowingly violate any rule, it would be unfair to the relevant staff, and either you overwork them, or understaff your roster.
Problem #3: Fairness
A lot of wards require balancing of weekday and weekend shifts. That’s easy to say, and hard to execute.
Fairness of shifts sometimes need to succumb to the rules of the ward, but it’s hard to tell to which degree you could sacrifice. If any staff works too much/little compared to the rest, it’s hard for your team to not hold grudges for that.
This is a big contributor to scheduling staff burn-out — they’re burdened with the work schedule of their entire team, often without proper training, and have to receive critiques if they couldn’t make the roster fair enough.
Problem #4: Considering the “Hidden Rules” of Rostering
There are implicit “hidden rules” that are usually not stated clearly. For example:
- Keeping staff request satisfaction rates >90%
- Spacing out staff shifts across the month
Now, these rules do seem evident to the human mind, but they’re often glossed over because of how supposedly “simple” they are.
If you’re not aware of these hidden rules, it’s unlikely you could make a roster that could be approved by seniors.
What About Online Schedulers?
Before making my own solution, I Googled rostering solutions very hard on the Internet. Here are some solutions I found and why they didn’t work:
1. Excel Wrappers
A big portion of online rostering apps are in fact, wrappers of Excel. They come with all sorts of fancy functions such as consideration of skill sets, work hours, etc. But what they don’t have, is an auto-fill function.
It means you still have to assign call rosters manually for each staff. And that takes a lot of time.
2. Rule-Based Rostering Apps
A few apps, such as Rosterlab, do in fact provide rule-based rostering algorithms. However, most of them operate under a set library of rules, (and sometimes objectives,) and fall short of the very specific rules that appear in real life wards. (e.g. calculating roster scores for doctors for shifts on weekends and HK public holidays).
On an additional note, these apps are notoriously hard to set up. Not fit for a busy doctor.
Chapter 1: Accurately Modelling Ward Rules
Before I started building anything, I knew that the hardest task would be to transform roster rules into constraints.
I have had experiences with Operations Research, and using that experience I built a beta version of the app and launched it for Dr Ma.
Here’s a quick screenshot of the app.

Under the hood, I’m using mathematical models from operations research to build the algorithm.
It took me multiple iterations with Dr Ma, as well as some innovative modelling techniques in order to make the rules fit perfectly for his use case. In fact, some of the techniques are invented in-house and I’ve not seen anyone on the Internet model similarly as I did.
And this web app worked perfectly for Dr Ma. With the proper optimization, we’ve been able to turn Dr Ma’s 8-hour-scheduling-streak down to a whopping 20 seconds (19 seconds of waiting for the cloud server to spin up, and 1 second for the algorithm to run).
I’m still quite proud of how fast it could run.
Chapter 2: Simplifying Set Up
But still, it was difficult to set up all the rules, despite my best efforts to make it as intuitive as possible.
I was also worried that the app would get overly complex as I add in more and more rules for different situations. Doctors are busy enough handling patients, and they shouldn’t be tasked with the responsibility of learning a new system from the scratch.
Therefore, I decided to take away all the rule-building functionality, and help clients manage the rules from the back-end.
This gave me much greater flexibility in managing the rules and objectives, while avoiding cluttering of the app. This is where 8 Hours started pivoting from a pure web app to consultancy service.
Chapter 3: Adding in Flexibility
A lot of wards have rules that people try to satisfy, but if it cannot be done then it’s still ok.
For example, one of my clients would like to pair up professors with interns as much as possible, but that’s not a strict rule.
In order to handle that, I’ve added in the ability to set up soft constraints in the algorithm. It has provided great flexibility and allowed the 8 Hours Algorithm to consider almost all possible ward rules.
Transforming Roster Automation With Algorithms
Slowly but surely, our efforts pay off, and today we’re working with multiple wards to save time for doctors by automating their rostering process.
Case Studies
- Dr. Ma, our first client, was spending 8 hours a month scheduling for 30+ staff over 5 seniorities. Our algorithm was doing it for him in under 1 minute.
- Dr. Lau was an associate consultant in KWH, spending 4-6 hours a month scheduling for his team, which has 27 staff over 3 seniorities. We took that and reduced it to 2 minutes.
- More case studies to come…
Optimize Your Ward Scheduling with Expert Assistance
Our Scheduling Service
If you’re looking to implement an efficient, fair, and compliant ward roster scheduling system, we can help. We offer personalized algorithm development and web-based solutions tailored to your specific needs. Learn more about how we can transform your scheduling process.
Learn to Schedule with Program
If you want to try make your own rostering algorithm, you can learn it with our free e-book, “Programmatic Roster Scheduling”. This guide introduces you to the basics of using programming to create efficient and fair schedules. You will learn how to translate ward rules into code, automate repetitive tasks, and generate optimized rosters with ease. Because most doctors have little programming experience, I’ve written it for beginners in Python. Download it for free and start learning now!
Follow Us for More Insights!
I post regularly at my LinkedIn. Follow me for more updated programmatic rostering insights!