Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

CalculateEndDate ( startDate ; days ; wkEnds )

Rate this function:  

  Average rating: 3.9  (45 votes)
  Discuss this Custom Function

Steve Allen, Richard Carlton Consulting, Inc.

Calculate End Date given Start Date and number of days, inclusive; handles weekends. NOT Recursive.

Sample Input:
CalculateEndDate ( '6/4/2010' ; 8 ; 0 )
Sample Output:

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed


Allows to calculate the end of a date range, given the start of the range, and the number of days in the range.

Has a parameter for weekends. Specifying TRUE is saying "the number of days specified includes weekends", and therefore returns the calendar day range (equivalent to Start + Days - 1).

Specifying FALSE for the weekends parameter is saying "the number of days specified does NOT include weekends -- it's only business days," and so to get the correct end date, it adds the weekends in.

There are several function "out there" that do this, but this is the only one I know of that does it using Math, not recursion. In my experience with the others, this one is much faster, especially on long ranges.

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

This is my Custom Function and I want to edit it


5 most recent comments | Show all 6 comments


What if you need to subtract multiple months from a date, maintaining the same "day" (ie. 15th of the month)? This seems complex since some months have more days than others.


Jeffrey E. Bloch, Fairfield, CT
February 15, 2011 3:38pm


The built-in Date function will allow you to do that.

Just use:

Date (
Month ( mydate ) - number_of_months_to_subtract
; Day ( mydate )
; Year ( mydate )

FileMaker will take care of the rest.


Steve Allen

Steve, Fairfield, CA
February 15, 2011 3:41pm

Hi Steven, I've found an issue with this function but not sure how to resolve it. I was trying to use it to calculate the end date after X working days excluding weekends:

Start Date = 25/7/2011 (25 July)
Days: 26
Exclude weekends

The function gives me an end date of 27/8/2011 , which is actually a saturday. The result I would expect is 29th of August which is the monday.

I have checked this manually and the final day after 26 is definitely the 29th. The function is beyond me in terms of figuring out how to fix it sorry.

Daniel Wood, New Zealand
April 21, 2011 6:02pm

I, like Daniel found a problem with this. I came up with the following, which seems to be working nicely:

Note: Unlike Steven's original function, this one always excludes week ends....

Let ([
/* Calculates startDate + days excluding week ends */
day = If(DayOfWeek(startDate)=1;7;DayOfWeek(startDate)-1)
; output = startDate + days + If(day = 6; 2 ; 0) +
(Floor ( ( days -1 + ( If(day=6;1; Mod ( day ; 6 )^1 ) ) ) /5 ) *2 )


Chris Wessels, Sydney, Australia
January 25, 2012 10:05pm

With Chris's version, an input date of date ( 5 ; 28 ; 2016 ), I expected Date ( 6 ; 10 ; 2016 ), but got Date ( 6 ; 13 ; 2016 ).

It may be an edge case, but it seems like a date starting on the weekend produces unexpected results. I ended up using CompletionDate by Daniele Raybaudi:

dansmith65, BC, Canada
June 02, 2016 5:34pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 8 + 5 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. ExcludeValues(MyList ; Out)
  (Wed, Mar 21, 7:23am)
2. PreviousMonthEndDate ( myDate )
  (Wed, Mar 07, 3:35am)
3. PreviousMonthName (myDate)
  (Wed, Mar 07, 3:33am)
4. FmTableFields ( tableName ; fieldsInclude ; fieldsExclude ; classExclude ; typeExclude ; prefixExclude )
  (Fri, Mar 02, 6:32am)
5. sql.getTable ( fullyQualifiedFieldObject )
  (Thu, Feb 22, 8:36am)
6. sql.getField ( fullyQualifiedFieldObject )
  (Thu, Feb 22, 8:34am)
7. FilterOut ( ListA ; ListB )
  (Wed, Feb 21, 6:11pm)
8. Char0 ( )
  (Sun, Feb 18, 2:35am)

RSS Feed of Custom Functions