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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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