Brian Dunning's FileMaker Custom Functions

CountWorkingDays ( DateStart ; DateEnd )

Returns the number of working days between two dates.

  Average rating: 4.5 (13 votes) Log in to vote

Cristos Lianides-Chin   Cristos Lianides-Chin - Show more from this author
Codence
https://www.codence.com

Share on Facebook Share on Twitter

  Sample input:
$example1 = CountWorkingDays ( "7/18/2016" ; "7/20/2016" )
$example2 = CountWorkingDays ( "7/20/2016" ; "7/18/2016" )
  Sample output:
$example1 = 3
$example2 = -3

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Returns the number of working days between two dates:
* if DateStart is BEFORE DateEnd, returns a positive number
* if DateStart is AFTER DateEnd, returns a negative number

 

Comments

Helder Moreira   Helder Moreira
Aug 8, 2024
It is missing 1 day.
example:
from 22/07/2024 to 02/08/2024 is counting 9 days.
Am I wrong? how can I fixe it?
 
Cristos Lianides-Chin   Cristos Lianides-Chin, Codence
Aug 8, 2024
@Helder thanks for the bug report! I've updated the function so that it's tallying the first day correctly. Please use v1.1, above.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: