How to create work shifts based on these conditions?

PhBarreto

New Member
Joined
Aug 9, 2016
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hello guys!
In an Excel spreadsheet, I have two sheets, 'Workers' and 'Shift'.
I need one worker from each sector based on the 'Workers' sheet to be scheduled per week (52 weeks) if there is more than one.
If there is only one consultant, he must be scheduled weekly, if not, I would like the worker to be repeated after everyone has worked their weekly shifts.
Are there any formulas so I can achieve this result?
Thanks in advance!

Sheet 'Workers'
Plantão Semanal - Projeto Klabin.xlsx
ABCD
1SequenceWorkersSectorShift
21Name 1Sector 1Yes
32Name 2Sector 1Yes
43Name 3Sector 1Yes
54Name 4Sector 1No
65Name 5Sector 1No
71Name 6Sector 2Yes
82Name 7Sector 2Yes
93Name 8Sector 2Yes
104Name 9Sector 2No
115Name 10Sector 2Yes
126Name 11Sector 2Yes
131Name 12Sector 3No
141Name 13Sector 4Yes
152Name 14Sector 4Yes
163Name 15Sector 4Yes
171Name 16Sector 5No
181Name 17Sector 6Yes
191Name 18Sector 7Yes
202Name 19Sector 7Yes
213Name 20Sector 7Yes
221Name 21Sector 8No
231Name 22Sector 9Yes
242Name 23Sector 9Yes
253Name 24Sector 9Yes
264Name 25Sector 9No
271Name 26Sector 11Yes
281Name 27Sector 12Yes
291Name 28Sector 13Yes
301Name 29Sector 14No
311Name 30Sector 15Yes
322Name 31Sector 15Yes
333Name 32Sector 15Yes
341Name 33Sector 16Yes
352Name 34Sector 17Yes
361Name 35Sector 18Yes
371Name 36Sector 19No
Weeks



Sheet 'Shift'
Plantão Semanal - Projeto Klabin.xlsx
ABC
1Week's IndexSectorWorker
21Sector 1
31Sector 2
41Sector 3
51Sector 4
61Sector 5
71Sector 6
81Sector 7
91Sector 8
101Sector 9
111Sector 11
121Sector 12
131Sector 13
142Sector 1
152Sector 2
162Sector 3
172Sector 4
182Sector 5
192Sector 6
202Sector 7
212Sector 8
222Sector 9
232Sector 11
242Sector 12
252Sector 13
263Sector 1
273Sector 2
283Sector 3
293Sector 4
303Sector 5
313Sector 6
323Sector 7
333Sector 8
343Sector 9
353Sector 11
363Sector 12
373Sector 13
Testes


Desired result
Plantão Semanal - Projeto Klabin.xlsx
ABC
1Week's IndexSectorWorker
21Sector 1Name 1
31Sector 2Name 6
41Sector 3-
51Sector 4Name 13
61Sector 5-
71Sector 6Name 17
81Sector 7Name 18
91Sector 8-
101Sector 9Name 22
111Sector 11Name 26
121Sector 12Name 27
131Sector 13Name 28
142Sector 1Name 2
152Sector 2Name 7
162Sector 3-
172Sector 4Name 14
182Sector 5-
192Sector 6Name 17
202Sector 7Name 19
212Sector 8-
222Sector 9Name 23
232Sector 11Name 26
242Sector 12Name 27
252Sector 13Name 28
263Sector 1Name 3
273Sector 2Name 8
283Sector 3-
293Sector 4Name 15
303Sector 5-
313Sector 6Name 17
323Sector 7Name 20
333Sector 8-
343Sector 9Name 24
353Sector 11Name 26
363Sector 12Name 27
373Sector 13Name 28
Testes
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
which version of excel are you using?
i suggest adding to your profile so anytime you make a post readers will know.
also, does the shift "yes" or "no" column play a part in scheduling?
 
Last edited:
Upvote 0
which version of excel are you using?
i suggest adding to your profile so anytime you make a post readers will know.
also, does the shift "yes" or "no" column play a part in scheduling?
Hello, @ExcelLoki!

Q-which version of excel are you using?
A- 365
Q-Does the shift "yes" or "no" column play a part in scheduling?
A- Yes!

What do you mean by that? Or how do I do this?
"...i suggest adding to your profile so anytime you make a post readers will know...."

Edit1
I was able to add office 365 to my profile.
 
Last edited:
Upvote 0
try this
---------------
Book1
ABC
1Week's IndexSectorresult
21Sector 1Name 1
31Sector 2Name 6
41Sector 3-
51Sector 4Name 13
61Sector 5-
71Sector 6Name 17
81Sector 7Name 18
91Sector 8-
101Sector 9Name 22
111Sector 11Name 26
121Sector 12Name 27
131Sector 13Name 28
142Sector 1Name 2
152Sector 2Name 7
162Sector 3-
172Sector 4Name 14
182Sector 5-
192Sector 6Name 17
202Sector 7Name 19
212Sector 8-
222Sector 9Name 23
232Sector 11Name 26
242Sector 12Name 27
252Sector 13Name 28
263Sector 1Name 3
273Sector 2Name 8
283Sector 3-
293Sector 4Name 15
303Sector 5-
313Sector 6Name 17
323Sector 7Name 20
333Sector 8-
343Sector 9Name 24
353Sector 11Name 26
363Sector 12Name 27
373Sector 13Name 28
Shift
Cell Formulas
RangeFormula
C2:C37C2=IFERROR(IFERROR(INDEX(FILTER(Workers!$B$2:$B$37,(Workers!$C$2:$C$37=Shift!B2)*(Workers!$D$2:$D$37="Yes")),COUNTIF($B$2:B2,B2)),INDEX(FILTER(Workers!$B$2:$B$37,(Workers!$C$2:$C$37=Shift!B2)*(Workers!$D$2:$D$37="Yes")),1)),"-")
 
Upvote 0
Almost... column A 'Week's Index', in the 'Shift' sheet means the week of the year. We have 52.
For example, from week 4 onwards, for Sector 1, a single consultant repeats, and it should be for week 4 Name 1, for week 5 Name 2, for week 6 Name 3 and so on.

I applied a simple filter to make it easier to understand:

Current results:
Plantão Semanal - Projeto Klabin (1).xlsx
ABC
1Week's IndexSectorWorker
21Sector 1Name 1
32Sector 1Name 2
43Sector 1Name 3
54Sector 1Name 1
65Sector 1Name 1
76Sector 1Name 1
87Sector 1Name 1
98Sector 1Name 1
109Sector 1Name 1
Planilha1


Desired result:
Plantão Semanal - Projeto Klabin (1).xlsx
ABC
13Week's IndexSectorWorker
141Sector 1Name 1
152Sector 1Name 2
163Sector 1Name 3
174Sector 1Name 1
185Sector 1Name 2
196Sector 1Name 3
207Sector 1Name 1
218Sector 1Name 2
229Sector 1Name 3
Planilha1
 
Upvote 0
@ExceLoki Please forgive me! I ended up forgetting to thank you. Thank you very much for your attention and help.

Does anyone else have any ideas on how to solve this problem?
Thanks in advance!
 
Upvote 0
glad to help, and looks like might have a solution
 
Upvote 0
glad to help, and looks like might have a solution
I'm also thinking there's a solution, you've renewed my hope. I had been trying for a week and couldn't make any progress. The only thing missing is the issue of the loop between workers. I hope someone else comes along to help.
Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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