0

Creating a Script Similar to Excel NETWORKDAYS

So, I'm thinking of replacing my workdays formulas with something similar to excel's networkdays function.  What I would need it to do, is combine the workdays function and then reference a Table I create that has the companies pre-planned days off (holidays, etc) to not factor those days into the formula.  Anybody else ever create something like this?

2 replies

null
    • Fred
    • 7 mths ago
    • Reported - view

    Check out this post.

      • Dave_Irving
      • 7 mths ago
      • Reported - view

       Nice, works perfectly!  Built it into my existing code.

       

      let t := this;
      let xBase := ('Clark Leads'.Chronos order by 'Date + Time');
      let xCurIndex := index(xBase, t);
      if xCurIndex = 0 then
          0
      else
          let xPrev := item(xBase, xCurIndex - 1);
          workdays(xPrev.date('Date + Time'), t.date('Date + Time')) - 1 -
          cnt(select '2023-2024 Holiday Schedule' where Date >= xPrev.date('Date + Time') and Date <= t.date('Date + Time'))
      end
      

Content aside

  • Status Answered
  • 7 mths agoLast active
  • 2Replies
  • 52Views
  • 2 Following