Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted

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.

Posted

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 ) )

This topic is 6524 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.