Skip to content
FitRank

Shift scheduling

Shift scheduling: fill the hardest shift first, or one slot stays empty

By Yaseen Khatib, , 6 min read

Shift scheduling: fill the hardest shift first, or one slot stays empty

Short answer. Shift scheduling goes wrong when you fill the calendar from Monday to Sunday. People with a weekly cap spend it early, and the one day few people can work is left short. Fill the slot with the fewest eligible people first, then spread the rest evenly. Same people, same limits, no empty shift.

The week I am about to describe has six people and twenty-three shifts, and it is small enough to check by hand. That is why I use it. I wanted to see for myself whether the order in which you fill a schedule matters as much as managers say it does.

I build FitRank, and one of the free tools on this site is a schedule generator. It starts with an example team: Asha, Ben, Chen, Dev, Elena and Farid. Each has a weekly maximum and some days they cannot work. Elena, for example, can take three shifts at most and cannot work Tuesday or Thursday. Chen cannot work Saturday or Sunday.

The manager's problem, in plain words

You have a week to cover. Most days are easy because everybody can work them. One day is not: on Saturday, only five of the six people can work at all, and it needs a third shift on top of the usual two. You write the rota from Monday forward, because that is how the week reads. By Friday you are short on Saturday, and nobody did anything wrong.

The test I ran

In the example, Saturday has one extra shift, called Saturday cover, with one person on it. I changed that to two people. That makes 23 slots to fill (two on every morning, one on every evening, two on Saturday cover) against 27 shifts of capacity, once you add up what each person can take and the days they are free.

Then I ran the same fill twice. The first run uses the order the generator ships with: slots with the fewest possible people first. The second run is my own variation, written for this test and not shipped: slots in calendar order, Monday morning first. Everything else is identical: the same pick rule (the available person with the fewest shifts so far), the same one-shift-per-day limit, the same people.

The empty place on Saturday was not a shortage of people. Five people could work Saturday. Ben and Farid were already on the Saturday morning shift and Dev on the evening, and the two left were Asha and Elena. But Elena had already used all three of her shifts on Monday, Wednesday and Friday mornings, because those came first on the calendar. A person with a low cap and a short list of days is a resource you spend carefully, and a calendar-order fill spends it on the first thing it sees.

Why a hardest-first order works

The generator counts, for every slot, how many people could take it and subtracts the number it needs. Saturday cover on a Saturday has few spare people. A Tuesday morning has more. It fills the lowest numbers first. By the time it reaches an easy Tuesday, a lot of people are available, so it can afford to be fair: give the slot to the person with the fewest shifts so far.

This is a greedy method, and I say so on the tool page. It is deterministic, which helps, since you can see what moved when you change an input. It is not optimal. On awkward inputs a careful planner can find a cover that it misses. If you want a precise statement of what it does and does not know, the tool page lists it.

Shift scheduling rules you can copy

None of this needs software. These are the rules I now follow when I fill a week by hand, with the rule that mattered most first:

  1. List every slot and how many people each needs before you write a single name.
  2. For each slot, count who could work it. Subtract the number needed. Fill the smallest numbers first.
  3. Keep a running count of shifts per person and give each slot to whoever has the fewest so far, unless that person is the only one who can take a harder slot later.
  4. Write down each person's weekly cap and days off before you start, not as you go.
  5. At the end, check three things: no empty slot, nobody over their cap, nobody on two shifts in a day.

If you prefer a grid with formulas to check hours and coverage, the free Excel employee schedule template does the counting and highlights an empty shift before the week starts. If you want the fill itself, use the generator and read the unfilled slots it reports.

What the generator does not check

It does not know skills, rest between a late shift and an early one, or fairness over several weeks. Those are rules a good shift schedule needs, and a greedy loop that only knows availability and a cap will break them without telling you. I would rather say that on the page than have someone publish a rota that works on screen and fails on Monday.

Where FitRank fits

FitRank is not a shift grid. It ranks people for an open task in project and services work, with the facts and a reason for each name, and a manager decides. The same instinct applies there: look at the task that only a few people can do before the one anybody can do. If that sounds like your problem, see how FitRank decides or the pricing page.

What is shift scheduling?

Shift scheduling is deciding who works which shift on which day, so every shift has the people it needs and nobody goes over their limits. It is the same job as rostering.

How do you make a shift schedule?

List every shift and how many people it needs, note each person's days off and weekly maximum, fill the shifts with the fewest possible people first, then spread the rest evenly and check for empty shifts.

Why does the order I fill shifts in matter?

People with a low weekly cap run out early if you fill the calendar from Monday. In my test the same six people covered 23 of 23 slots when the hardest slot came first, and 22 of 23 when slots were filled in calendar order.

Is there a free shift scheduling template?

Yes. The employee schedule template on this site is a free Excel file with weekly and monthly grids, shift codes and hours and coverage worked out by formula.

More from the blog

Be one of the first teams to staff with FitRank

We're taking on a small number of pilot companies. Pre-register for early access, or talk to us about an annual licence.