Jump to content

counting work days only


Bob T

This topic is 4940 days old. Please don't post here. Open a new topic instead.

Recommended Posts

senerio, trying to count the number of days it takes to move product from one dept. to the next but not including Sat and Sun (here is the kicker)and every other Friday. I have date stamps on the transactions to and from and a calculation that gives me the cycle time, but that includes our days off. How do I get a realistic cycle time?

Link to comment
Share on other sites

It sounds to me like you do not have a well defined mathematical way of determining whether any given day is a work day or not. Whether any given Friday is a workday is idiosyncratic because it depends on your particular schedule. What about holidays, etc.

In this context you might want to create a Calendar table with one record for each day of the year. in which you can designate a 'Work Day' field with 1's, vs 0's for off days. To calculate the number of work days in a range just do a Find for the dates meeting your criteria and then sum up the Work Day field.

Link to comment
Share on other sites

This is indeed a "kicker". Try =


Let ( [ 

pattern = "10000011000011" ;

n = EndDate - StartDate + 1 ;

w = Div ( n ; 14 ) ;

r = Mod ( n ; 14 ) ; 

s = Mod ( StartDate ; 14 ) + 1 ; 

p = Middle ( pattern&pattern ; s ; r ) ;

x = w * PatternCount ( pattern ; "1" ) + PatternCount ( p ; "1" )

] ;

n - x

)

I haven't tested this very thoroughly. Note that this assumes Friday Nov 4, 2010 is a workday.

Link to comment
Share on other sites

you might want to create a Calendar table with one record for each day of the year. in which you can designate a 'Work Day' field with 1's, vs 0's for off days.

I believe a table of holidays only would be quite sufficient. To account for holidays in the given range, you can use a relationship and subtract the related records count.

Note that holidays that fall on weekends must be excluded from the count.

Link to comment
Share on other sites

I do have advanced and I will try this. I looked at it briefly and looks to be exactly what I need. Further more, I can make every other Friday a holiday. SWEET!

Thanks all for the responses and I will post my results.

Link to comment
Share on other sites

No, Daniele, comment was asking me if I had read the original question. I had. I think knowing these CFs exist is helpful in itself. Who knows whether every other Friday can be taken literally--he might just need to enter all exempt days as Holidays.

Link to comment
Share on other sites

ALL IS WELL !!!

Another wrinkle on the brain. This has been a tremendous help for me.

I believe I would have eventually found a solution, yet God knows how long it would have taken.

I appreciate all your help

Regards,

Bob

Link to comment
Share on other sites

This topic is 4940 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.