FormulaLab · Challenge
#001 · The Overlapping Shifts · Intermediate

The Overlapping Shifts

Intermediate FRM
Excel 2019+ · Helper columns: allowed · Dynamic arrays: not required

You’ll identify exactly where staffing coverage peaks and valleys — and see the gaps a manager can’t find by scrolling.

Pinecrest Urgent Care runs three shifts — Day, Swing, and Night. Nurses can work partial shifts and overlap windows exist between them. The clinic manager needs to know: for each hour of the day, how many nurses are on the floor? The scheduling system exports a start time and end time per nurse per day — but it doesn’t calculate concurrent coverage. The board meets Thursday.

Download shift_log.xlsx
Sheet 1 — Shift Log
NurseID NurseName Date ShiftStart ShiftEnd
N-014Rivera2026-04-0707:0015:30
N-022Okafor2026-04-0714:0022:30
N-031Chen2026-04-0722:0006:30
N-014Rivera2026-04-0807:0015:30
N-019Patel2026-04-0806:0014:00
N-033Williams2026-04-0814:0022:30
N-022Okafor2026-04-0814:0022:30
N-041Santos2026-04-0822:0006:30
N-019Patel2026-04-0906:0014:00
N-031Chen2026-04-0907:3016:00
180 rows · 1 week of shifts · Sheet 2 contains the hours template (168 rows)
Target Specification

Fill Column C (NursesOnFloor) in the Hours Template for every hour of every day.
· Monday April 7 at 15:00 should read: 4
· Sunday April 13 at 03:00 should read: 1

Think about what makes a nurse “on the floor” during a given hour — and how you’d test two time-based conditions at once.
Start with a single hour. What would have to be true about a nurse’s start time and end time for them to still be working at 15:00?
=COUNTIFS(ShiftStart,"<="&HourCell,ShiftEnd,">"&HourCell)

where HourCell is the current hour in the Hours Template (e.g. B2 containing the datetime for Monday April 7 at 15:00).

A nurse is on the floor during a given hour if their shift started at or before that hour AND their shift hasn’t ended yet. COUNTIFS lets you test both conditions across the entire schedule at once — counting only the rows where both are true. Drag the formula down 168 rows and the coverage map builds itself.

Σ
FRM-0011 · COUNTIFS/SUMIFS
Multi-Condition Aggregation
View in Learn →
← Browse all challenges #002 — coming soon