• Resolved filipzitko

    (@filipzitko)


    Hello,

    iam trying to find out how to calculate days between two dates but only working days (same as NETWORKDAYS in Excel), weekends excluded. I know theres DATEDIFF, however it counts days, weekend included. Can you please help me how to exclude weekend days? Is that even possible in the plugin?

    Thank you
    Kind Regards,
    Filip

    • This topic was modified 3 years, 8 months ago by filipzitko.
Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @filipzitko

    Thank you very much for using our plugin. In the current plugin version, you should walk the days and exclude weekends.

    For example, assuming the date fields are fieldname1 and fieldname2, insert a calculated field in the form and enter the following equation:

    (function(){
        var d1 = MIN(fieldname1, fieldname2), 
            d2 = MAX(fieldname1, fieldname2), 
            result = 0;
        while(d1<=d2){
            if( AND( WEEKDAY(d1) != 1, WEEKDAY(d1) != 7 ) ) result += 1;
            d1 += 1;
        }
        return result;
    })()

    Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Workdays between two dates’ is closed to new replies.