If statement or vba code requirement

Gealer

New Member
Joined
Sep 19, 2018
Messages
19
I run a report giving me the shift patterns of colleagues.

I need to break down what shift pattern they are on so forexample we have the following. So in the 1st columns I have in A 1and then in B & C I have those starting 1 then 2 in B and in C will bethose starting on 2 then 1 and then the 3 more for those on rotation 3.


Rotation 1 – standard Mon – Fri (
Rotation 2 – those who start their shift pattern this weekand those who started last week.
Rotation 3 ect.


So my requirement is that I need to put an identifier nextto the colleague to determine the column they will allocated to.
[TABLE="width: 397"]
<tbody>[TR]
[TD="width: 67, bgcolor: transparent"]
Rotations
[/TD]
[TD="width: 75, bgcolor: transparent"]
Shift Date
[/TD]
[TD="width: 80, bgcolor: transparent"]
Shift Day
[/TD]
[TD="width: 68, bgcolor: transparent"]
Shift Start
[/TD]
[TD="width: 63, bgcolor: transparent"]
Shift End
[/TD]
[TD="width: 75, bgcolor: transparent"]
Shift Hours
[/TD]
[TD="width: 103"]
Shift Pattern ID
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
1
[/TD]
[TD="width: 75, bgcolor: transparent"]
26/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
09:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
17:00
[/TD]
[TD="width: 75, bgcolor: transparent"]
7
[/TD]
[TD="width: 103"]
1
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
1
[/TD]
[TD="width: 75, bgcolor: transparent"]
26/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
09:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
17:00
[/TD]
[TD="width: 75, bgcolor: transparent"]
7
[/TD]
[TD="width: 103"]
1
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
1
[/TD]
[TD="width: 75, bgcolor: transparent"]
26/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
09:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
17:00
[/TD]
[TD="width: 75, bgcolor: transparent"]
7
[/TD]
[TD="width: 103"]
1
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
3
[/TD]
[TD="width: 75, bgcolor: transparent"]
26/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
09:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
17:30
[/TD]
[TD="width: 75, bgcolor: transparent"]
7.5
[/TD]
[TD="width: 103"]
4
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
2
[/TD]
[TD="width: 75, bgcolor: transparent"]
19/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
08:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
16:30
[/TD]
[TD="width: 75, bgcolor: transparent"]
8
[/TD]
[TD="width: 103"]
3
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
2
[/TD]
[TD="width: 75, bgcolor: transparent"]
26/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
09:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
17:30
[/TD]
[TD="width: 75, bgcolor: transparent"]
8
[/TD]
[TD="width: 103"]
2
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
1
[/TD]
[TD="width: 75, bgcolor: transparent"]
27/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Tuesday
[/TD]
[TD="width: 68, bgcolor: transparent"]
07:45
[/TD]
[TD="width: 63, bgcolor: transparent"]
17:15
[/TD]
[TD="width: 75, bgcolor: transparent"]
9
[/TD]
[TD="width: 103"]
1
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
2
[/TD]
[TD="width: 75, bgcolor: transparent"]
19/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
07:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
16:00
[/TD]
[TD="width: 75, bgcolor: transparent"]
8
[/TD]
[TD="width: 103"]
3
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
2
[/TD]
[TD="width: 75, bgcolor: transparent"]
19/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
08:30
[/TD]
[TD="width: 63, bgcolor: transparent"]
17:00
[/TD]
[TD="width: 75, bgcolor: transparent"]
7.75
[/TD]
[TD="width: 103"]
3
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
2
[/TD]
[TD="width: 75, bgcolor: transparent"]
26/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
08:15
[/TD]
[TD="width: 63, bgcolor: transparent"]
16:30
[/TD]
[TD="width: 75, bgcolor: transparent"]
7.75
[/TD]
[TD="width: 103"]
2
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
3
[/TD]
[TD="width: 75, bgcolor: transparent"]
12/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
08:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
16:30
[/TD]
[TD="width: 75, bgcolor: transparent"]
7.5
[/TD]
[TD="width: 103"]
6
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
3
[/TD]
[TD="width: 75, bgcolor: transparent"]
13/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Tuesday
[/TD]
[TD="width: 68, bgcolor: transparent"]
09:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
17:30
[/TD]
[TD="width: 75, bgcolor: transparent"]
7.5
[/TD]
[TD="width: 103"]
6
[/TD]
[/TR]
[TR]
[TD="width: 67, bgcolor: transparent"]
3
[/TD]
[TD="width: 75, bgcolor: transparent"]
19/11/2018
[/TD]
[TD="width: 80, bgcolor: transparent"]
Monday
[/TD]
[TD="width: 68, bgcolor: transparent"]
09:00
[/TD]
[TD="width: 63, bgcolor: transparent"]
11:00
[/TD]
[TD="width: 75, bgcolor: transparent"]
2
[/TD]
[TD="width: 103"]
5
[/TD]
[/TR]
</tbody>[/TABLE]

Not sue what the best option would be formula or VBA?

 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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