Using Excel to create a schedule table from given data table.

Theneoalchemist

New Member
Joined
Mar 6, 2020
Messages
5
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Everyone, This has been stumping me for about a week now and I need assistance. My work's scheduling program produces a horrible table to track schedules and I am trying to take the information it outputs and create a printable schedule from it. I have been able to do it for most of the shifts utilizing Mod functions as well as Maxifs and Minif functions but I am running into issues regarding Overnight shifts and Overtime shifts. This stems from the fact that this output file our system generates creates multiple line items for each date which highlights non worked hours and overtime hours. So when working for the overnight shift and if the shift has overtime there can be multiple rows of data for any given date, which makes Maxifs and Minifs complicated to work with given all the parameters.

This means that if an employee works Wednesday over night, 2200 - 0900 and then comes back at 2200 for their next shift, the output file will look like so

Full NameWork DateTime CodeHour TypeStart TimeEnd TimeHours
Employee #108/23/2023WRKREG22:0000:002.00
Employee #108/24/2023WRKREG00:0008:008.00
Employee #108/24/2023WRKOT1.508:0009:001.00
Employee #108/24/2023GAPUNPAID09:0022:0011.00
Employee #108/24/2023WRKOT1.522:0000:002.00
Employee #108/25/2023DAYCUTUNPAID00:0008:008.00
Employee #108/25/2023WRKREG00:0008:008.00

Another issue I am running into is that the system will take a shift, lets say Friday 10pm to Saturday 6am, and split that into two line items. I tried to counteract this utilizing a OFFSET function but have ran into errors again due to how it reads the lines of data. I will post examples below.

I want to take this ( had to remove non important information but wanted to keep the columns in place

Full NameWork DateTime CodeHour TypeStart TimeEnd TimeHours
Employee #108/18/2023WRKREG00:0006:006.00
Employee #108/20/2023WRKREG22:0000:002.00
Employee #108/20/2023DAYCUTUNPAID00:0006:006.00
Employee #108/21/2023WRKREG00:0006:006.00
Employee #108/21/2023GAPUNPAID06:0022:0016.00
Employee #108/21/2023WRKREG22:0000:002.00
Employee #108/21/2023DAYCUTUNPAID00:0006:006.00
Employee #108/22/2023WRKREG00:0006:006.00
Employee #108/22/2023GAPUNPAID06:0022:0016.00
Employee #108/22/2023WRKREG22:0000:002.00
Employee #108/22/2023DAYCUTUNPAID00:0006:006.00
Employee #108/23/2023WRKREG00:0006:006.00
Employee #108/23/2023GAPUNPAID06:0022:0016.00
Employee #108/23/2023WRKREG22:0000:002.00
Employee #108/23/2023DAYCUTUNPAID00:0006:006.00
Employee #108/24/2023WRKREG00:0006:006.00
Employee #108/24/2023GAPUNPAID06:0022:0016.00
Employee #108/24/2023WRKREG22:0000:002.00
Employee #108/24/2023DAYCUTUNPAID00:0006:006.00
Employee #208/19/2023WRKREG14:0022:008.00
Employee #208/20/2023WRKREG14:0022:008.00
Employee #208/21/2023WRKREG14:0022:008.00
Employee #208/22/2023WRKREG14:0022:008.00
Employee #208/23/2023WRKREG14:0022:008.00
Employee #308/18/2023WRKREG14:0022:008.00
Employee #308/21/2023WRKREG14:0022:008.00
Employee #308/22/2023WRKREG14:0022:008.00
Employee #308/23/2023WRKREG14:0022:008.00
Employee #308/24/2023WRKREG14:0022:008.00
Employee #408/18/2023WRKREG00:0006:006.00
Employee #408/18/2023GAPUNPAID06:0022:0016.00
Employee #408/18/2023WRKREG22:0000:002.00
Employee #408/18/2023DAYCUTUNPAID00:0006:006.00
Employee #408/19/2023WRKREG00:0006:006.00
Employee #408/19/2023GAPUNPAID06:0022:0016.00
Employee #408/19/2023WRKREG22:0000:002.00
Employee #408/19/2023DAYCUTUNPAID00:0006:006.00
Employee #408/20/2023WRKREG00:0006:006.00
Employee #408/20/2023GAPUNPAID06:0022:0016.00
Employee #408/20/2023WRKREG22:0000:002.00
Employee #408/20/2023DAYCUTUNPAID00:0006:006.00
Employee #408/21/2023WRKREG00:0006:006.00
Employee #408/23/2023WRKREG22:0000:002.00
Employee #408/23/2023DAYCUTUNPAID00:0006:006.00
Employee #408/24/2023WRKREG00:0006:006.00
Employee #408/24/2023GAPUNPAID06:0022:0016.00
Employee #408/24/2023WRKREG22:0000:002.00
Employee #408/24/2023DAYCUTUNPAID00:0006:006.00
Employee # 508/18/2023WRKREG14:0022:008.00
Employee # 508/21/2023WRKREG14:0022:008.00
Employee # 508/22/2023WRKREG14:0022:008.00
Employee # 508/23/2023WRKREG14:0022:008.00
Employee # 508/24/2023WRKREG14:0022:008.00
Employee # 608/18/2023WRKREG06:0014:008.00
Employee # 608/21/2023WRKREG06:0014:008.00
Employee # 608/22/2023WRKREG06:0014:008.00
Employee # 608/23/2023WRKREG06:0014:008.00
Employee # 608/24/2023WRKREG06:0014:008.00

And have it look like this afterwards (This part has already been completed using a mixture of Index and Match, but the issue is getting the "##:## - ##:##" part right for Graveyard shifts.) As you can see. I am also trying to incorporate that if the line item only has half the shift (For instance, officer gets off in the morning and has the night off) as a blank value and have it shown on the night the shift starts. I have usually been able to accomplish this with adding 1 day to the Maxif's function that would display it. But again, I have been having some issues with this.)

Employee NameFridaySaturdaySundayMondayTuesdayWednesdayThursday
08/18/202308/19/202308/20/202308/21/202308/22/202308/23/202308/24/2023
Employee #12200 - 06002200 - 06002200 - 06002200 - 06002200 - 0600
Employee #21400-22001400 - 22001400-22001400-22001400-2200
Employee #31400-22001400-22001400-22001400-22001400-2200
Employee #42200 - 06002200 - 06002200 - 06002200 - 06002200 - 0600
Employee #51400 - 22001400 - 22001400 - 22001400 - 22001400 - 2200
Employee #60600 - 14000600 - 14000600 - 14000600 - 14000600 - 1400

I feel once someone assists me it will be a simple solution but I am honestly flustered at this point and have been trying to solve this for days. Any help will be greatly appreciated
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi Everyone, This has been stumping me for about a week now and I need assistance. My work's scheduling program produces a horrible table to track schedules and I am trying to take the information it outputs and create a printable schedule from it. I have been able to do it for most of the shifts utilizing Mod functions as well as Maxifs and Minif functions but I am running into issues regarding Overnight shifts and Overtime shifts. This stems from the fact that this output file our system generates creates multiple line items for each date which highlights non worked hours and overtime hours. So when working for the overnight shift and if the shift has overtime there can be multiple rows of data for any given date, which makes Maxifs and Minifs complicated to work with given all the parameters.

This means that if an employee works Wednesday over night, 2200 - 0900 and then comes back at 2200 for their next shift, the output file will look like so

Full NameWork DateTime CodeHour TypeStart TimeEnd TimeHours
Employee #108/23/2023WRKREG22:0000:002.00
Employee #108/24/2023WRKREG00:0008:008.00
Employee #108/24/2023WRKOT1.508:0009:001.00
Employee #108/24/2023GAPUNPAID09:0022:0011.00
Employee #108/24/2023WRKOT1.522:0000:002.00
Employee #108/25/2023DAYCUTUNPAID00:0008:008.00
Employee #108/25/2023WRKREG00:0008:008.00

Another issue I am running into is that the system will take a shift, lets say Friday 10pm to Saturday 6am, and split that into two line items. I tried to counteract this utilizing a OFFSET function but have ran into errors again due to how it reads the lines of data. I will post examples below.

I want to take this ( had to remove non important information but wanted to keep the columns in place

Full NameWork DateTime CodeHour TypeStart TimeEnd TimeHours
Employee #108/18/2023WRKREG00:0006:006.00
Employee #108/20/2023WRKREG22:0000:002.00
Employee #108/20/2023DAYCUTUNPAID00:0006:006.00
Employee #108/21/2023WRKREG00:0006:006.00
Employee #108/21/2023GAPUNPAID06:0022:0016.00
Employee #108/21/2023WRKREG22:0000:002.00
Employee #108/21/2023DAYCUTUNPAID00:0006:006.00
Employee #108/22/2023WRKREG00:0006:006.00
Employee #108/22/2023GAPUNPAID06:0022:0016.00
Employee #108/22/2023WRKREG22:0000:002.00
Employee #108/22/2023DAYCUTUNPAID00:0006:006.00
Employee #108/23/2023WRKREG00:0006:006.00
Employee #108/23/2023GAPUNPAID06:0022:0016.00
Employee #108/23/2023WRKREG22:0000:002.00
Employee #108/23/2023DAYCUTUNPAID00:0006:006.00
Employee #108/24/2023WRKREG00:0006:006.00
Employee #108/24/2023GAPUNPAID06:0022:0016.00
Employee #108/24/2023WRKREG22:0000:002.00
Employee #108/24/2023DAYCUTUNPAID00:0006:006.00
Employee #208/19/2023WRKREG14:0022:008.00
Employee #208/20/2023WRKREG14:0022:008.00
Employee #208/21/2023WRKREG14:0022:008.00
Employee #208/22/2023WRKREG14:0022:008.00
Employee #208/23/2023WRKREG14:0022:008.00
Employee #308/18/2023WRKREG14:0022:008.00
Employee #308/21/2023WRKREG14:0022:008.00
Employee #308/22/2023WRKREG14:0022:008.00
Employee #308/23/2023WRKREG14:0022:008.00
Employee #308/24/2023WRKREG14:0022:008.00
Employee #408/18/2023WRKREG00:0006:006.00
Employee #408/18/2023GAPUNPAID06:0022:0016.00
Employee #408/18/2023WRKREG22:0000:002.00
Employee #408/18/2023DAYCUTUNPAID00:0006:006.00
Employee #408/19/2023WRKREG00:0006:006.00
Employee #408/19/2023GAPUNPAID06:0022:0016.00
Employee #408/19/2023WRKREG22:0000:002.00
Employee #408/19/2023DAYCUTUNPAID00:0006:006.00
Employee #408/20/2023WRKREG00:0006:006.00
Employee #408/20/2023GAPUNPAID06:0022:0016.00
Employee #408/20/2023WRKREG22:0000:002.00
Employee #408/20/2023DAYCUTUNPAID00:0006:006.00
Employee #408/21/2023WRKREG00:0006:006.00
Employee #408/23/2023WRKREG22:0000:002.00
Employee #408/23/2023DAYCUTUNPAID00:0006:006.00
Employee #408/24/2023WRKREG00:0006:006.00
Employee #408/24/2023GAPUNPAID06:0022:0016.00
Employee #408/24/2023WRKREG22:0000:002.00
Employee #408/24/2023DAYCUTUNPAID00:0006:006.00
Employee # 508/18/2023WRKREG14:0022:008.00
Employee # 508/21/2023WRKREG14:0022:008.00
Employee # 508/22/2023WRKREG14:0022:008.00
Employee # 508/23/2023WRKREG14:0022:008.00
Employee # 508/24/2023WRKREG14:0022:008.00
Employee # 608/18/2023WRKREG06:0014:008.00
Employee # 608/21/2023WRKREG06:0014:008.00
Employee # 608/22/2023WRKREG06:0014:008.00
Employee # 608/23/2023WRKREG06:0014:008.00
Employee # 608/24/2023WRKREG06:0014:008.00

And have it look like this afterwards (This part has already been completed using a mixture of Index and Match, but the issue is getting the "##:## - ##:##" part right for Graveyard shifts.) As you can see. I am also trying to incorporate that if the line item only has half the shift (For instance, officer gets off in the morning and has the night off) as a blank value and have it shown on the night the shift starts. I have usually been able to accomplish this with adding 1 day to the Maxif's function that would display it. But again, I have been having some issues with this.)

Employee NameFridaySaturdaySundayMondayTuesdayWednesdayThursday
08/18/202308/19/202308/20/202308/21/202308/22/202308/23/202308/24/2023
Employee #12200 - 06002200 - 06002200 - 06002200 - 06002200 - 0600
Employee #21400-22001400 - 22001400-22001400-22001400-2200
Employee #31400-22001400-22001400-22001400-22001400-2200
Employee #42200 - 06002200 - 06002200 - 06002200 - 06002200 - 0600
Employee #51400 - 22001400 - 22001400 - 22001400 - 22001400 - 2200
Employee #60600 - 14000600 - 14000600 - 14000600 - 14000600 - 1400

I feel once someone assists me it will be a simple solution but I am honestly flustered at this point and have been trying to solve this for days. Any help will be greatly appreciated
Can you please submit your solution as it is using XL2BB so that we can see where you have got to?
 
Upvote 0

Forum statistics

Threads
1,223,880
Messages
6,175,157
Members
452,615
Latest member
bogeys2birdies

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