On call schedule

txlawdog

New Member
Joined
Jan 12, 2022
Messages
6
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
  3. Mobile
I am trying to create a formula that checks one cell for the day of the week and another cell to determine if the week of the year is an even number or and odd number. It would then need to select a number from a key that has been set up on another sheet. I have attached a screen shot of the calendar and weekday rotation for reference. The on call schedule is set up so that an investigator is on call on a weekday every other week and Sat and Sun every nine weeks. This has stumped me thus far. I am not a expert at Excel, yet my supervisor thinks I am and asked me to create the calendar.
Annotation 2022-01-12 084821.jpg
Annotation 2022-01-12 090000.jpg
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
ECSO CID ScheduleJanuary/2022
DAY OF MONTH:12345678910111213141516171819202122232425262728293031
SatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMon
ADMIN
Lt. Thompson110M-F 8-5 WWWWW WWWWW WWWWW WWWWW W
PERSONS CRIMES
Sgt. Hundley##M-TH 8-7 WWWW WWWW WWWW WWWW W
CAPRS
Inv. McIntosh##M-TH 8-7 WWWW WWWW WWWW WWWW W
Inv. Key131TU-F 8-7 WWWW WWWW WWWW WWWW
CAC
Inv. Clay##M-TH 8-7 WWWW WWWW WWWW WWWW W
SOR/JAIL CASES
Inv. Westmoreland##M-TH 8-7 WWWW WWWW WWWW WWWW W
PROPERTY CRIMES
Sgt. Fitzgerald121TU-F 8-7 WWWW WWWW WWWW WWWW
WEST SIDE
Inv. Pollins##TU-F 8-7 WWWW WWWW WWWW WWWW
Inv. Atilano##M-TH 8-7 WWWW WWWW WWWW WWWW W
EAST SIDE
Inv. Houston##TU-F 8-7 WWWW WWWW WWWW WWWW WEEK 1Week 2
Inv. Pearson##M-TH 8-7 WWWW WWWW WWWW WWWW WMondayTuesdayWednesdayThursdayFridayMondayTuesdayWednesdayThursdayFriday
FINANCIAL/FRAUD126910584711
Inv. Shelton##TU-F 8-7 WWWW WWWW WWWW WWWW
CRIME SCENE
CSI Katie Gildner##M-F 8-5 WWWWW WWWWW WWWWW WWWWW W
PROPERTY TECH
Holly HatcherM-F 8-5 WWWWW WWWWW WWWWW WWWWW W
CASE CLERK
Laura GaitherM-F 8-5 WWWWW WWWWW WWWWW WWWWW W
INVESTIGATORS ON DUTY:0071212126007121212600712121260071212126007
ON CALL INVESTIGATOR1111#69#44458471155#69#66658471177#
ON CALL SGT. Sgt. Fitzgerald Sgt. HundleySgt. Fitzgerald Sgt. HundleySgt. Fitzgerald Sgt. Hundley
WEEK OF THE YEAR:1222222233333334444444555555566
TIME OFF KEY:TTRAININGCCOMPVVACATIONHHOLIDAYPPERSONALSSICK
CALL SCHEDULE KEY:1THOMPSON3HUNDLEY5PEARSON7ATILANO9WESTMORELAND11Pollins
2FITZGERALD4CLAY6MCINTOSH8SHELTON#Key12Houston
 
Upvote 0
I have posted a mini sheet above. The part I am interested in is the "On Call Investigator"
 
Upvote 0
Try this for the weekday:

WorkbookY.xlsm
F
335
Sheet4
Cell Formulas
RangeFormula
F33F33=IF(ISODD(WEEKNUM(F3)),INDEX($AM$24:$AQ$24,MATCH(TEXT(F3,"DDDD"),$AM$23:$AQ$23,0)),INDEX($AR$24:$AV$24,MATCH(TEXT(F3,"DDDD"),$AR$23:$AV$23,0)))


Note that Excel will have week 2 starts on 1/2/22 because 1/1/2022 starts on Saturday

Im still confused on the Sat and Sunday
 
Upvote 0
Note that Excel will have week 2 starts on 1/2/22 because 1/1/2022 starts on Saturday

So therefore 1/2/22 - 1/7/22 is considered an even number since Excel will register it as 2nd week and not 1st week. since your starting on Monday anyways I would change

Excel Formula:
IF(ISODD(WEEKNUM(F3)),INDEX($AM$24:$AQ$24,MATCH(TEXT(F3,"DDDD"),$AM$23:$AQ$23,0)),INDEX($AR$24:$AV$24,MATCH(TEXT(F3,"DDDD"),$AR$23:$AV$23,0)))

to

Excel Formula:
IF(ISEVEN(WEEKNUM(F3)),INDEX($AM$24:$AQ$24,MATCH(TEXT(F3,"DDDD"),$AM$23:$AQ$23,0)),INDEX($AR$24:$AV$24,MATCH(TEXT(F3,"DDDD"),$AR$23:$AV$23,0)))

and if you want to give more explanation on weekend we can add another if statement for that to the above formula.
 
Upvote 0
The weekends are on a rotating schedule of 9 weeks. The numbering system starts with 4 and goes to 12. The even week FRI is covered by the weekend on-call. For example; this year #12 was on call the first weekend, the following weekend #4 was on call and covered Friday, as well as Sat and Sun. #5 was next, but did not cover Friday as it was covered by the weekday schedule.
 
Upvote 0
The even week FRI is covered by the weekend on-call
Sorry for the late reply But im still lost how this year #12 begin on the first weekend. can you provide more details.
 
Upvote 0
This is because the on-call rotation for weekends does not restart at the beginning of the year. It continues from the previous year. Therefore the 1st weekend was #12.
 
Upvote 0

Forum statistics

Threads
1,215,050
Messages
6,122,868
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top