← Prev in month
← Prev in thread
Re: [office-formula] Who's doing what this week, Redux (including a requestto Stefan Nikolas)
The existing function deals with whole days. Excel explicitly defines it that way. Even if you give it a date serial number that is noon one day to 5pm another day, it will not return a fractional number of workdays. I'm not suggesting we expand it to include such a feature. My interest was purely in the internationalization aspect, that the legal definition of the work week in some nations is not M-F. So, we handle it by simply adding an optional enumeration value which defines what a weekend is. 0 (default) = Sat/Sun, 1=Thurs/Friday and 2=Friday/Sat. If we wanted the full generality, we could have instead an optional array parameter of 7 values, evaluated as booleans for whether that day of the week is a weekend or not. That has the advantage of working for partial week schedules as well as 1-day weekends. -Rob ___________________________ Rob Weir Software Architect Workplace, Portal and Collaboration Software IBM Software Group email: phone: 1-978-399-7122 blog: http://www.robweir.com/blog/ "David A. Wheeler" <> 02/14/2007 01:36 PM Please respond to To cc Subject Re: [office-formula] Who's doing what this week, Redux (including a request to Stefan Nikolas) David A. Wheeler wrote: > > Robert Weir has volunteered to do NETWORKDAYS and WORKDAY, since they > > have the same I18N issues. Basically, he's going to need to add an > > additional optional parameter to handle internationalization Eike Rathke responded: > If we add a parameter that no application is supporintg yet I suggest to > define it the way that if the parameter is not given comply with the > Ecma/Excel definition. Eases interoperability. Oh, absolutely, that was the reason I want it optional. Sorry I didn't make that clear. It's really not just Ecma/Excel; I think everyone does it the same way. > > - not EVERYONE's weekend is Saturday/Sunday. I see two major options: > > (1) a parameter saying which day of the week begins a two-day weekend, > > or ... > > (2) a parameter that's a boolean representation of the days of the > > week that are to be considered non-workdays. Option #2 is more > > flexible, but also is harder to implement and explain... does anyone > > care which way he goes? > Eike adds a #3: > It may also be necessary to include half days, as in "Saturday is half > day off, Sunday one day". The most flexible IMHO would be to have an > array with a factor in the range [0,1] for each weekday, if that's not > considered overkill. Eek. Actually, you can even pile on the overkill further; many people in the U.S. work in 2-week cycles, so they work 5 days one week and 4 days in the alternate week. That would add yet another option: #4: The new optional parameter accepts an array; if 14 days instead of 7, it that describes a two-week cycle. I think #3 and #4 are more flexible but would be much harder to use. You could partly address that yet another option: #5: Merge #2, #3, #4. Basically, detect if the new parameter is a scalar number, and if so, interpret as #2. If the new param is array/multi-cell range, then interpret as #3 or #4 (depending on its length). That might make common cases easier to use, and still be very flexible - but it's more work to implement. I have to admit that #3, #4, and #5 seem awfully like overkill to me. Does anyone have an opinion on what is best for our purposes? --- David A. Wheeler
← Prev in month
← Prev in thread