# My WeekDaySub formula appears to have excluded Christmas Day 2015 but not New Years Day 2016?

• 0
• Question
• Updated 4 years ago
I have the following numeric formula in a parent table:

([Billable Hours Current Month Not CW]/WeekdaySub(PrevDayOfWeek(Today(), 6),FirstDayOfMonth(Today())))*WeekdaySub(LastDayOfMonth(Today()),FirstDayOfMonth(Today()))

The field [Billable Hours Current Month Not CW] is a summary field.  I'll give a quick example to explain what the formula does:

Assume today is Jan 15, 2016.
billable hours through Today = \$2000
billable hours through the most recently past Saturday (1/9/2016) = \$1500
# of business days prior to most recently past Saturday = 6 (Jan 1,4,5,6,7,8)
# of business days in the month = 21
The formula does this:  (1500/6)x(21)

My Question:  I've studied the resulting calculations very thoroughly, and I have determined that without any doubt, the formula counted 22 total business days in December 2015, but counted 21 in January.  Why?  Am I missing something?
• 220 Points

Posted 4 years ago

• 0
• 72,680 Points
I have not looked at your formula, but just to be sure that you are aware of what the weekday Sub does - it counts weekdays like M T W Th and Fridays but not weekend days.  It has no awareness of holidays.
• 220 Points
I am aware, but I can't figure out why it counted 22 days in December and not 23.
• 72,680 Points
Well, because WeekDaySub works like regular subtraction and perhaps differently from a similar a excel function.

For example. December has 31 days. But 31 - 1 = 30.

So you need to add 1 to count both the first and last day.