Convert Schedules to Interval Staffing

kamiljaku

New Member
Joined
Jan 5, 2018
Messages
21
Hey,

i want to convert a schedule into interval staffing with VBA. How to start this project?

1. Read the data into a array.
2. Calculate each shift duration.
3. ????


Please help me with some guidelines. I dont expect to receive here the full code but at least information what I need to google in the web.

Thanks in advance :)

KaEcym.jpg
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hey,

Given the setup above the cells N7:T21 will be outputted with the given code:

Code:
Sub OutputTime()
    Dim i As Integer, j As Integer
        For i = 7 To 21
            For j = 14 To 20
                Cells(i, j).Formula = "=IFERROR(SUMPRODUCT((TIMEVALUE(LEFT(" & _
                Split((Columns(j - 10).Address(, 0)), ":")(0) & "$7:" & _
                Split((Columns(j - 10).Address(, 0)), ":")(0) & "$19,4))<=VALUE($M" & i & "))*(TIMEVALUE(RIGHT(" & _
                Split((Columns(j - 10).Address(, 0)), ":")(0) & "$7:" & _
                Split((Columns(j - 10).Address(, 0)), ":")(0) & "$19,5))>=VALUE($M" & i & "))),0)"
            Next j
        Next i
End Sub
 
Upvote 0
I wish to make this happen too using Google Sheets. This time, the source will be coming from a different sheet in the same file. What's going to be the formula?
 
Upvote 0
I wish to make this happen too using Google Sheets. This time, the source will be coming from a different sheet in the same file. What's going to be the formula?
Welcome to the Board!

Google Sheets is an entirely different beast than Excel, and there is no guarantee that those involved in this thread know how to do it in Google Sheets (or if they have even ever used Google Sheets before!).

I recommend you start a new thread on the topic, and post it to the "General Excel Discussion & Other Questions" forum (https://www.mrexcel.com/forum/general-excel-discussion-other-questions/), and be sure to make it very clear that you are looking for a Google Sheets solution. You can post a link back to this thread in your question, if you feel that may be helpful to people.
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

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