March 15, 200718 yr Newbies I would like to calculate how many days it takes to finish a project. It is an easy formula: shipDate - invoiceDate. What I would like to be able to do is eliminate any weekend days that would be contained in that formula. If I'm working on a project for two days I don't want it to show up as four days because I worked on it Friday and Monday.
March 15, 200718 yr Hi try to enter this custom function: /* WorkingDays ( dateStart ; dateEnd ) parameters: dateStart = date dateEnd = date Returns all the dates between dateStart and dateEnd w/o weekends */ Let([ dateStart = Case ( DayOfWeek ( dateStart ) = 7 ; dateStart + 2 ; DayOfWeek ( dateStart ) = 1 ; dateStart + 1 ; dateStart ); result = Case ( dateStart < dateEnd ; dateStart & ¶ & WorkingDays ( dateStart + 1 ; dateEnd ) ; dateStart = dateEnd ; dateStart ; "" ) ]; result ) The custom function returns, as text, a list of dates; for example: WorkingDays ( "02/09/2007" ; "02/19/2007" ) returns: 02/09/2007 02/12/2007 02/13/2007 02/14/2007 02/15/2007 02/16/2007 02/19/2007 To count the working days the calc is: ValueCount ( WorkingDays ( dateStart ; dateEnd ) )
Create an account or sign in to comment