Discussions

Expand all | Collapse all

How do I define work days

  • 1.  How do I define work days

    Posted 17 days ago
    Edited by Justin Finkelstein 12 days ago
    For one of my formulas, I need to count our specific work days between 2 dates.

    Our work days are only:
    Sunday
    Monday
    Tuesday
    Wednesday

    Please help!


  • 2.  RE: How do I define work days

    Posted 12 days ago
    Any advice from someone on this?

    ------------------------------
    Justin Finkelstein
    ------------------------------



  • 3.  RE: How do I define work days

    Posted 12 days ago
    I could probably help you , but I don't have any pre-built formula that I can post.  We would need to work one on one on a consulting basis.

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



  • 4.  RE: How do I define work days

    Posted 11 days ago
    Just looking for someone to point me in the right direction. Any help would be amazing!

    ------------------------------
    Justin Finkelstein
    ------------------------------



  • 5.  RE: How do I define work days

    Posted 10 days ago
    It's been a while - but what you can do is:
    Count the number of days between the start and end dates ToDays(startdate - enddate)
    Divide that number by 7.
    Multiply by 4 to get the work days in whole weeks
    Then you need to adjust for the number of days that remain that are work days for example;
    if there are 10 days in the period, and the first day of the period is Monday.
    Mo Tu We Th Fr Sa Su Mo Tu We
    Then you have 4 work days  + Mo Tu We all of which are work days
    So 7 total work days
    Basically the adjustment is calculated as follows:
    If the first date Mon
    - If the number of remaining days is less than 7, add 3
    - If the number of remaining days is less than 3, and all of them
    ...
    That's the basic formula. 



    ------------------------------
    Neil Schneider
    ------------------------------



  • 6.  RE: How do I define work days

    Posted 3 days ago
    This should give you a good starting point:

    If(DayOfWeek(endDate) > 3, 0, ToDays(NextDayOfWeek(startDate, 3) - startDate)) +
    (Int(ToDays(If(ToDays(endDate - NextDayOfWeek(endDate, 0)) = 7, endDate, NextDayOfWeek(endDate, 0)) - If(ToDays(NextDayOfWeek(startDate, 6) - startDate) = 7,  startDate, NextDayOfWeek(startDate, 6))) / 7) * 4 )+ If(DayOfWeek(endDate) > 3, 0, ToDays(endDate - PrevDayOfWeek(endDate, 0)))​


    ------------------------------
    Paul Peterson
    ------------------------------



  • 7.  RE: How do I define work days

    Posted 3 days ago
    Sorry, just noticed an error.  

    Try This instead:

    If(DayOfWeek(startDate) > 3, 0, ToDays(NextDayOfWeek(startDate, 3) - startDate)) +
    (Int(ToDays(If(ToDays(endDate - NextDayOfWeek(endDate, 0)) = 7, endDate, NextDayOfWeek(endDate, 0)) - If(ToDays(NextDayOfWeek(startDate, 6) - startDate) = 7, startDate, NextDayOfWeek(startDate, 6))) / 7) * 4 )+ If(DayOfWeek(endDate) > 3, 0, ToDays(endDate - PrevDayOfWeek(endDate, 0)))

    ------------------------------
    Paul Peterson
    ------------------------------