Skip to main content
Question

Total work days in a Month

  • February 3, 2021
  • 0 replies
  • 157 views

Forum|alt.badge.img+5
Hello,

I am trying to calculate the total work days in a month based on today's date.  Here is my formula but it is not working correctly, I am getting a total of 25 days for February and there are only 20 working days in February for this year.  Dates and duration formulas in Quick Base are new for me so any help is appreciated. 

Formula:
ToDays(ToWeekdayP(LastDayOfMonth([Today's Date])) - (ToWeekdayN(FirstDayOfMonth([Today's Date]))))

My team wants to see what business day they are on (which I figured out) and then how many business days are in each month.  

Thanks

------------------------------
Jennifer Silberstein
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • February 3, 2021
There is a special function in QuickBase which knows how to count just the weekdays, just the Monday to Fridays.  This would be a formula numeric field type

For clarity I will break this down in little pieces.

var date FirstDay = FirstDayOfMonth(Today());
var date LastDay = LastDayOfMonth(Today());

WeekdaySub($LastDay, $FirstDay) + 1


------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------