Brian Dunning's FileMaker Custom Functions

Weekdays ( startDate ; endDate )

The number of weekdays between two dates

  Average rating: 4.3 (28 votes) Log in to vote

Reinder Wolting   Reinder Wolting
ABECON
http://www.abecon.nl

Share on Facebook Share on Twitter

  Sample input:
Weekdays ( dec 29 2004 ; jan 10 2005 )
  Sample output:
8

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

Just like the function Barbecue posted. But not recursive, so a bit faster for longer periods of time.

The dates in the example above are specified this way to avoid confusion between european and american date notation. Use normal date fields in your caculations!

 

Comments

PANOS   PANOS, GREECE
Nov 20, 2009
Very nice but put and the first day of the year, Christmas and and other official holidays for each country for example for Greece, thera are 6 January, 25 Μαρτίου, 15 August, etc.
Thanks
 
PANOS   PANOS, GREECE
Nov 20, 2009
Very nice but put and the first day of the year, Christmas and and other official holidays for each country for example for Greece, there are 6 January, 25 March, 15 August, 26 December etc. and comment
Thanks
 
databaser   databaser, CA
Dec 3, 2011
I haven't tested this, but I don't see the need. How can it possibly work without the dayname function?

If you have 4 days between two dates for example, if the start date is Monday then you have 4 weekdays; if it's friday, you have 2. So how could you get this right without using the dayname function?
 
brad   brad, El Segundo
Jan 21, 2014
I had a hard time getting the recursive functions to work. This one saved me! Thanks!
 
Ariel   Ariel, 95134
Feb 3, 2014
Really appreciate this feedback! I was not able finalize my formula until I saw this one. Thank you!
 
Philip McGeehan   Philip McGeehan, SMD Ltd
Jun 18, 2015
Doesn't always calculate correctly.
Take 1st April 2015 to 30th April 2015.
It should be 22 days; but it calculates 21.
 
Peter   Peter, Norristown, PA
Aug 25, 2015
Has an error, Put in 10/10/2014 and 10/22/2014 and it returns 8, but should return 9 days.
 
Tom Fitch   Tom Fitch
Sep 11, 2018
To those saying it calculates one day less than you expect -- that's not an error. You're wanting it to count the total number of weekdays. But this is counting the *difference* between the two dates. Tomorrow - today = 1, not 2.

Seems to work well.

To databaser's comment, DayName has nothing to do with it. It's math.
 

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.

Under construction. Email me your wish list for improvements.