A staff rota looks trivial until someone swaps a shift, someone goes sick, and the hours stop adding up. Then you rebuild the whole thing by hand at 11pm.
These are the formulas I use in a small team rota so the sheet keeps itself honest. Everything works in Excel and in Google Sheets with the same syntax.
1. One row per person, one column per day
Keep the grid boring:
- Column A: staff name
- Columns B to H: Monday to Sunday
- Row 1: dates, real dates, formatted however you like
Type the Monday date in B1, then in C1 use =B1+1 and drag across. Real dates matter, because every formula below reads them.
2. Stop the shift codes from drifting
Use short codes in the cells: M for morning, L for late, N for night, OFF for a day off. Then count them.
Shifts per person for the week:
=COUNTIF(B2:H2,"M") Total shifts worked:
=COUNTIF(B2:H2,"M")+COUNTIF(B2:H2,"L")+COUNTIF(B2:H2,"N") If you would rather not repeat that, put the codes in a named range and use SUMPRODUCT:
=SUMPRODUCT(--(B2:H2={"M","L","N"})) 3. Flag anyone working too many days in a row
Six days straight is where mistakes start. This counts the longest run of non-OFF cells in a row:
=MAX(FREQUENCY(IF(B2:H2<>"OFF",COLUMN(B2:H2)),IF(B2:H2="OFF",COLUMN(B2:H2)))) In Excel 365 and Google Sheets, enter it normally. In older Excel, confirm it with Ctrl+Shift+Enter.
To flag a whole sheet at once, put it in conditional formatting as a formula rule over B2:H20:
=MAX(FREQUENCY(IF($B2:$H2<>"OFF",COLUMN($B2:$H2)),IF($B2:$H2="OFF",COLUMN($B2:$H2))))>5 4. Count coverage per shift, per day
The other half of the problem is a day with no one on lates. In a summary block under the grid:
=COUNTIF(B$2:B$20,"L") One column per day, one row per code, and you can see at a glance that Thursday has nobody on nights.
5. Turn codes into hours
Keep a tiny lookup table somewhere off to the side: code in column A, hours in column B.
=SUMPRODUCT(COUNTIF(B2:H2,$K$2:$K$5),$L$2:$L$5) That gives total scheduled hours for the person without a single manual entry.
6. Handle shift swaps without losing the original
When two people swap, do not overwrite the cell. Add a note column and log it: date, who swapped with whom, who approved it. A rota with no trail is how the argument starts.
If you want the sheet to catch a swap that breaks coverage, the coverage block in step 4 does it for you: after the edit, the day that lost a late shift shows one fewer.
7. The part everyone forgets
Lock the formula cells before you share the file. Review > Protect Sheet, allow only the shift grid. Half the "the rota is broken" messages are someone typing over a formula.
What this looks like finished
A one-week grid that counts shifts per person, counts coverage per day, totals hours from a lookup table, and highlights anyone past five days straight. It takes about twenty minutes to build once, and then it is a template you reuse every week.
I keep a finished version of this as an Excel template, with the coverage block, the hours lookup and the over-five-days flag already wired up. It is the Staff Shift Rota template, six dollars: https://youssef1818.gumroad.com/l/shift-rota
If you run a small business rather than one team, the same formulas sit inside the Small Business Starter Kit, which bundles the rota with cash flow, quoting, inventory, CRM and profit and loss sheets: https://youssef1818.gumroad.com/l/small-business-kit

