Function overview
Prototype
WorkingDays (
DateStart; DateEnd; HolidayList )
Parameters
DateStart
DateEnd
HolidayList
Description
Tags:
Date
Returns the number of working days between the two dates w/o weekends and holidays.
All you need to do is create the holiday list.
Examples
Sample input
WorkingDays ( "07/07/2010" ; "07/07/2010" ; YourList )
Sample output
1
Function code
/*
WorkingDays ( DateStart ; DateEnd ; HolidayList )
returns the number of working days between the two dates.
No weekend days nor any day of the HolidayList
*/
Let (
$counter = $counter + ( Mod ( DateStart - 1 ; 7 ) < 5 and IsEmpty ( FilterValues ( DateStart ; HolidayList ) ) );
Case(
DateStart > DateEnd ; "" ;
DateStart = DateEnd ; $counter & Let( $counter = "" ; "" );
WorkingDays ( DateStart + 1 ; DateEnd ; HolidayList )
)
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/261
Prototype: WorkingDays( DateStart; DateEnd; HolidayList )
Function Author: Daniele Raybaudi (http://www.fmfunctions.com/mid/38)
Last updated: 30 July 2010
Version: 1.1
*/
// ===================================
/*__LITBR__WorkingDays ( DateStart ; DateEnd ; HolidayList )__LITBR____LITBR__returns the number of working days between the two dates.__LITBR__No weekend days nor any day of the HolidayList__LITBR__*/__LITBR____LITBR__Let ( __LITBR__$counter = $counter + ( Mod ( DateStart - 1 ; 7 ) < 5 and IsEmpty ( FilterValues ( DateStart ; HolidayList ) ) );__LITBR__Case(__LITBR__DateStart > DateEnd ; "" ;__LITBR__DateStart = DateEnd ; $counter & Let( $counter = "" ; "" );__LITBR__WorkingDays ( DateStart + 1 ; DateEnd ; HolidayList )__LITBR__)__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/261__LITBR____LITBR__ Prototype: WorkingDays( DateStart; DateEnd; HolidayList )__LITBR__ Function Author: Daniele Raybaudi (http://www.fmfunctions.com/mid/38)__LITBR__ Last updated: 30 July 2010__LITBR__ Version: 1.1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.