Hello guys,
I hope someone can help me out with this.
I worked with schedules, I created a report that counts the amount of days off per week an agent has an also checks if they have at least more than 12 hours between shifts. Now I want to add the possibility to see if excel can check if they are not working more than 6 days in a row between 2 weeks.
Things you might need to know, the schedules are exported from IEX into a notepad, I already used some left formulas and vlookups to split the info, so I have the starting time in one cell and the end shift next to it, also I have OFF (as per day off) per cell, so every 2 cells belong to one day of information, I'm going to use "|" to show how the schedules look on excel per cell as an example for a person working 9:00am - 5:30 with Tuesday and Thursday OFF in one week and OFF on the next week on friday and saturday:
Agent X
Week 1
Monday Tuesday Wednes Thursday Friday Saturday Sunday
|09:00|05:00|OFF|OFF|09:00|05:00|OFF|OFF|09:00|05:00|09:00|05:00|09:00|05:00|
Week 2
Monday Tuesday Wednes Thursday Friday Saturday Sunday
|09:00|05:00|09:00|05:00|09:00|05:00|09:00|05:00|OFF|OFF|OFF|OFF|09:00|05:00|
Both weeks and on the same row, I split it over here because of the lack of space
So is there a way excel can count and tell me if this agent 'X' is working more than 6 consecutive days in a 2 weeks time period???
I'm using excel 2007
Thanks for the help and sorry for the mess of information
Cheers,
try this array (array entered with ctrl+shift and enter)
assuming times or off are in a2 through to ab2
=MAX(FREQUENCY(IF(INDEX(--ISNUMBER(A2:AB2),0)=1,COLUMN(A2:AB2)),IF(INDEX(--ISNUMBER(A2:AB2),0)<>1,COLUMN(A2:AB2))))/2
this finds the longest streak of times(2 per day) and divides by 2
stick >6 on the end to get true/false
=MAX(FREQUENCY(IF(INDEX(--ISNUMBER(A2:AB2),0)=1,COLUMN(A2:AB2)),IF(INDEX(--ISNUMBER(A2:AB2),0)<>1,COLUMN(A2:AB2))))/2>6
final formula will look like this when array entered
{=MAX(FREQUENCY(IF(INDEX(--ISNUMBER(A2:AB2),0)=1,COLUMN(A2:AB2)),IF(INDEX(--ISNUMBER(A2:AB2),0)<>1,COLUMN(A2:AB2))))/2>6}
Last edited by martindwilson; 07-16-2011 at 08:59 PM.
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks