2 Replies Latest reply on May 16, 2014 6:28 AM by jbrogers1234

# number of days not calculated correctly

### Title

number of days not calculated correctly

### Post

using the following:

If (IsEmpty (Day_StartDate); "";
5*Int((EndDate-StartDate)/7) + Middle("0012345501234544012343340123223401111234010012340";
7*(DayOfWeek(StartDate)-1) + DayOfWeek(EndDate);1) - Count ( HolidayFallData::Date )
)

to calculate the number of school days using a table of holidays and vacations, my calculation is off by one day!  can anyone see the error? For example between 7/1/2014 and 8/11/2014 there is one holiday July 4 and a total of 30 possible school days less 1 holiday it should be 29 but my calc = 28!  Hummm.....

• ###### 1. Re: number of days not calculated correctly

There are two ways to evaluate the number of days for such an interval. It's a matter of whether an interval such as:

Start Date = 7/1/14, End Date = 7/2/14 represents an interval of one day or two. This calc evaluates that as 1 day, not 2 so in your case you may need to add 1 to your result if the start date counts as one of the days.

• ###### 2. Re: number of days not calculated correctly

To PhilModJunk- in case I forgot as I have been a little swamped, thank you for your help I did not realize that the interval did not include day 1.  Again thanks

JBR