Found Dates between Gaps

vishal0589

Board Regular
Joined
May 13, 2014
Messages
63
Hi Friends,
I am working with a attendance register where I have to check gap between two subsequent Weekly Offs (W/O) with following conditions.
-> There must be 4 Present (P) between two Weekly Offs (W/O).
-> If Minimum 4 present (P) is not available between two Weekly Offs (W/O), dates of W/O will be resulted in columns

for example.

S. No.Emp. No.12345678910111213Output
1143PPPPW/OPPW/OPPPPW/O58
2499PW/OPPPPW/OPPPELELW/O713
3501PPPPCLPPPPW/OPPP
4505PW/OPPPPW/OCLPPPW/OP712
5
506PPCLPPW/OPELPPW/OPP611
6
509PW/OP
PPPW/OPPPPCLP
7758
PW/OPCLCLPW/OPPCLPW/OP2712

<colgroup><col span="2"><col><col span="17"></colgroup><tbody>
</tbody>

<colgroup><col span="2"><col><col><col span="18"></colgroup><tbody>
</tbody>



Please help me out.

Thanks in Advance.

CMA Vishal Srivastava
 
Yes your Idea is good but the matter of fact is that attendance would not require YTD analysis. So month to month variations in Weekly Off is not a problem. We may give 3 W/O in one month and 3 or 4 in another one.

Right now, I need to randomize the monthly attendance register. Need a macro to deal with.
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
THIS PATTERN FOR BLOCKS OF 5 EMPLOYEES ENSURES 7 W/O's IN A PERIOD OF 60 DAYS

<colgroup><col span="60"></colgroup><tbody>
</tbody>
 
Upvote 0
the pattern is designed for 4 minimum but if cl and el creep in I think manual intervention

otherwise a lot of time writing code to cover every eventuality....
 
Upvote 0
ok every time there are 4 P's, insert a W/O - could mean 6 W/O in 30 days

every time there are 5 P's insert a W/O - results in 4 or 5 W/O's

every time there are 6 P's max 4 W/O's but if cl and el could be only one or 2

I do not think as currently defined this can be automated - sorry
 
Upvote 0
No problem bob,
I will try to automate the solution and hoping for other members from the board to help me out.
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,047
Members
449,206
Latest member
Healthydogs

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