CalculateEndDate ( startDate ; days ; wkEnds )
Rate this function: Average rating: 3.1 (18 votes) Discuss this Custom Function
Steve Allen, Richard Carlton Consulting, Inc.
http://www.rcconsulting.com
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:
|
Description:
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 BrianDunning.com. Please contact the individual
developer with any questions or problems.
This is my Custom Function and I want to
edit it
Discuss:Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:
|
Newest Custom Functions:
| 1. |
CountWordOccurrences ( text ; searchWord ) |
| |
(Tue, Feb 07, 11:15am) |
| 2. |
indonesian_date(date) |
| |
(Mon, Feb 06, 7:14pm) |
| 3. |
phpArrayValue ( array ; key ; pos ) |
| |
(Fri, Jan 27, 1:49pm) |
| 4. |
solfm_timeToMinutes (theTime;roundSec) |
| |
(Fri, Jan 20, 6:26am) |
| 5. |
filterLines(filterField;filterValue;Result) |
| |
(Sat, Jan 14, 2:20pm) |
| 6. |
getMaxValue ( theList ) |
| |
(Thu, Jan 12, 1:06pm) |
| 7. |
MiddleWordsIncPunct ( text ; startingWord ; numberOfWords ) |
| |
(Sat, Jan 07, 9:16am) |
| 8. |
WindowInfo |
| |
(Fri, Jan 06, 12:39pm) |
 |
|
wkEnds fields, what type must to be?
and what includes?
When i put (0) zero then functions count correctly, but when put 1 for a holidays day, then does not work
PANOS, CREECE
June 10, 2010 2:29pm