ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Dates
  3. How to Build a Rotating Shift Schedule in Excel

How to Build a Rotating Shift Schedule in Excel

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

Type the rotation pattern once in a column, such as D, D, N, N, O, O, O, O for an 8-day cycle. Then find any date's shift with =INDEX(pattern,MOD(date-start_date+offset,cycle_length)+1). The date minus the start date counts the days, MOD wraps them into the cycle, and the offset staggers each team.

Key takeaways

  • Store the rotation pattern once as a list; every cell in the schedule reads from it.
  • =INDEX(pattern,MOD(date-start+offset,length)+1) returns the shift for any date and any team.
  • MOD gives the position inside the cycle; the +1 is needed because INDEX starts counting at 1.
  • An offset per team staggers the same pattern so the shifts are covered every day.
  • For a rotation that changes every week, divide the days by 7 with INT first.
On this page+
  1. What is a rotating shift schedule?
  2. Step 1: Set up the start date and the pattern
  3. Step 2: The INDEX and MOD formula
  4. Step 3: Stagger the teams with an offset
  5. Weekly rotations with INT and CHOOSE
  6. Check cover and highlight weekends
  7. Common problems and fixes
  8. Practise it

A rotating shift schedule in Excel repeats one pattern of shifts, such as two days, two nights and four days off, with each team starting at a different point in the cycle. Instead of typing every shift by hand, you type the pattern once and one formula, =INDEX(pattern,MOD(date-start+offset,length)+1), fills the whole calendar. This guide is for anyone who plans 24/7 or multi-team cover and wants a rota that extends itself for months.

If you only need a simple weekly grid with hand-typed shifts and cover checks, start with our guide to making a weekly shift schedule. This article focuses on the rotation itself.

What is a rotating shift schedule?#

A rotating schedule is a fixed sequence of shifts that repeats after a set number of days, called the cycle length. Each team works the same sequence, but starts at a different step, so the shifts are covered every day.

Here are three common examples of rotation patterns. They are illustrations only. The right pattern, shift length and rest time depend on your contracts and the working-time rules where you are, so check those before you publish a rota.

PatternSequenceCycle length
4 on, 4 offD, D, N, N, O, O, O, O8 days
2-2-3W, W, O, O, W, W, W, O, O, W, W, O, O, O14 days
Weekly rotationEarly week, Late week, Night week21 days

D is a day shift, N a night shift, W a working day and O a day off.

Step 1: Set up the start date and the pattern#

Every formula in the rota reads from two inputs: a start date and the pattern list. Put them where you can see them:

  • B1: the start date, Monday 2 November 2026. This is "day 0" of the cycle.
  • J2:J9: the pattern, one step per cell: D, D, N, N, O, O, O, O.
  • B2: the cycle length, =COUNTA(J2:J9), which returns 8.

Then build the date row. In C4 type =$B$1, and in D4 type =C4+1. Fill D4 to the right for as many days as you need. Excel stores dates as whole numbers, one per day, so +1 is always the next day. The date basics lesson explains how this works.

Step 2: The INDEX and MOD formula#

The core of the rota is one formula that turns a date into a step number and then into a shift. For a single team, it is:

Excel formula
=INDEX($J$2:$J$9,MOD(C$4-$B$1,$B$2)+1)

Read it from the inside out:

  1. C$4-$B$1 is the number of days since the start date. For 20 November it is 18. Subtracting one date from another is the simplest way to count the days between two dates.
  2. MOD(18,8) is the remainder after dividing by 8, which is 2. MOD wraps any number of days back into the range 0 to 7, so the pattern repeats forever.
  3. +1 turns the 0-to-7 position into a 1-to-8 row number, because INDEX starts counting at 1.
  4. INDEX($J$2:$J$9,3) returns the third item in the pattern: N.

The $ signs keep the pattern, start date and cycle length fixed while you fill the formula across. The $ in C$4 keeps every row pointing at the date row. The INDEX function guide and our article on MOD and INT in Excel cover both functions in more detail.

Step 3: Stagger the teams with an offset#

Give each team an offset, the number of steps it is ahead in the cycle, and add it to the day count. Put team names in A5:A8 and offsets in B5:B8, then type this in C5 and fill it across and down:

Excel formula
=INDEX($J$2:$J$9,MOD(C$4-$B$1+$B5,$B$2)+1)

With offsets of 0, 2, 4 and 6, the first eight days look like this:

TeamOffsetMon 2Tue 3Wed 4Thu 5Fri 6Sat 7Sun 8Mon 9
A0DDNNOOOO
B2NNOOOODD
C4OOOODDNN
D6OODDNNOO

Every column has exactly one D and one N, so days and nights are covered by four teams. On 20 November, Team D's shift is MOD(18+6,8)+1, which is step 1: D.

To change the rotation, edit the pattern list and the offsets. Every cell updates. Offsets are easier to manage than a different start date for each team, because the date row stays the same for everyone.

Weekly rotations with INT and CHOOSE#

When a shift changes once a week rather than every day, count whole weeks instead of days. INT((C$4-$B$1)/7) divides the days by 7 and drops the remainder, so days 0 to 6 are week 0, days 7 to 13 are week 1, and so on. Wrap that with MOD and pick the shift with CHOOSE:

Excel formula
=CHOOSE(MOD(INT((C$4-$B$1)/7)+$B5,3)+1,"Early","Late","Night")

With offsets of 0, 1 and 2, three teams work Early, Late and Night in turn. In the week starting 2 November, Team A is Early, Team B Late and Team C Night. A week later they all move one step on. CHOOSE is handy when the list is short; see how CHOOSE picks a value by position. For longer lists, keep using INDEX on a pattern range.

Check cover and highlight weekends#

A rotation is only useful if it covers every shift, so add a count under each date column:

Excel formula
=COUNTIF(C5:C8,"N")

This counts the night shifts on that date; it should be 1 in every column. A row that shows 0 or 2 means an offset or the pattern is wrong. The weekly shift schedule guide shows fuller cover checks with COUNTIFS, such as a supervisor on every shift.

Weekend columns often need extra attention for pay or cover. Use a conditional formatting rule with =WEEKDAY(C$4,2)>5 to shade them; our article on highlighting weekends walks through it.

Common problems and fixes#

Most rota errors come from the inputs, not the formula:

  • Every team shows the same shift. The offsets are missing, or the formula doesn't add $B5.
  • The pattern seems one day off. Check that B1 is the date of step 1 for a team with offset 0. Changing B1 by one day shifts the whole rota.
  • #VALUE! appears. A date was typed as text. Retype it as a real date, or use =DATE(2026,11,2).
  • The cycle length is wrong. If you add steps to the pattern, update the range, or the cycle length cell, so MOD wraps at the right point.
  • Dates before the start date. These still work: Excel's MOD returns 5 for MOD(-3,8), which is the correct step when you count backwards.

Practise it#

Try the exercise on this page to find Team D's shift with INDEX and MOD. Then practise date formulas in the date basics lesson and practise counting the days between dates in a live spreadsheet that checks each answer as you type.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Team D works the 8-day pattern in B2:B9 and starts at offset 6 (in E3). In E4, return Team D's shift on the date in E2, using the start date in E1. Use INDEX and MOD.

fx
ABCDEF
1
Step
Shift
Start date
46328
2
1
D
Date
46346
3
2
D
Offset
6
4
3
N
Shift
5
4
N
6
5
O
7
6
O
8
7
O
9
8
O
10
11
12

Tip: E2-E1 is the number of days since the start. Add the offset, take MOD(...,8), add 1, and use that as the row number in INDEX.

Practise this in a lesson

LessonHow Excel stores dates: DATE, YEAR, MONTH, DAYLearn why every date is secretly a number, then build dates with DATE and take them apart with YEAR, MONTH and DAY.LessonDays between dates: DAYS, DATEDIF and TODAYMeasure the gap between two dates in days, months and years, and calculate tenure as of today.Function guideINDEXLearn the Excel INDEX function: return a value by row and column position, build two-way lookups with MATCH, and practice live.

Frequently asked questions

How do I make a rotating schedule in Excel?

+

List the repeating pattern in a column, type a start date, and use =INDEX(pattern,MOD(date-start,length)+1) for each date. Fill it across the dates and down the teams, adding a different offset for each team.

What is a 4 on 4 off rotation?

+

It is a pattern where people work four shifts and then have four days off. A common version is two day shifts, two night shifts and four days off, which repeats every 8 days.

How do I rotate shifts weekly in Excel?

+

Count whole weeks since the start date with INT((date-start)/7), then wrap them with MOD. For example, =CHOOSE(MOD(INT((C4-$B$1)/7),3)+1,"Early","Late","Night") changes the shift every 7 days.

What does MOD do in a shift rotation formula?

+

MOD returns the remainder after division. MOD(days,8) turns any number of days into a position from 0 to 7, so the pattern starts again after every 8 days.

Can the schedule show dates before the start date?

+

Yes. Excel's MOD always returns a result with the same sign as the divisor, so MOD(-3,8) is 5. Dates before the start date still land on the right step of the cycle.

Sources

  • INDEX function - Microsoft Support
  • MOD function - Microsoft Support
  • CHOOSE function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What is a rotating shift schedule?
  2. Step 1: Set up the start date and the pattern
  3. Step 2: The INDEX and MOD formula
  4. Step 3: Stagger the teams with an offset
  5. Weekly rotations with INT and CHOOSE
  6. Check cover and highlight weekends
  7. Common problems and fixes
  8. Practise it

Keep reading

Projects· 6 min read

Make a Weekly Shift Schedule in Excel

A weekly shift schedule in Excel is a grid with one row per person and one column per day, filled with short shift codes such as E (early), L (late) and OFF. Type the week's start date once and build the other dates with +1. COUNTIF totals each person's shifts, and COUNTIFS checks that every day has enough people and a supervisor.

Math· 6 min read

MOD and INT in Excel: Remainders and Whole Numbers

MOD returns the remainder after division: =MOD(127,12) gives 7, because 12 goes into 127 ten times with 7 left over. INT rounds a number down to a whole number: =INT(127/12) gives 10. Use them together to split a quantity into full groups and what's left, such as boxes and spare items, or hours and minutes.

Logic· 7 min read

The CHOOSE Function in Excel

CHOOSE returns the value at a given position in a list you type into the formula. =CHOOSE(2,"Morning","Afternoon","Night") returns Afternoon, because it is item 2. The first argument must be a number from 1 to the number of items, or CHOOSE returns #VALUE!. It works in every version of Excel.

More on dates

  • Round Time to the Nearest 15 Minutes in Excel
  • Semimonthly Pay Schedule in Excel: 15th and Month-End Paydays
  • Calculate the Difference Between Two Times in Excel
  • How to Create 15-Minute Time Intervals in Excel
  • TODAY Function in Excel: Always-Current Dates
  • Convert a Unix Timestamp to a Date in Excel
All dates articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free