4

The following table in Emacs' org-mode automatically calculated the number of days between timestamps in columns 1 and 2 and put the results in column 3.

| <2015-07-24 Fri> | <2015-07-22 Wed> | 2 |
#+TBLFM: $3=$1-$2

I was wondering if there is a way to calculate the number of working days in the range given by columns 1 and 2, i.e. excluding weekends.

Stefan
  • 1,757
  • 1
  • 10
  • 8
  • 2
    That would require setting up a custom set of holidays to define what constitutes "working days". So as not to reinvent the wheel entirely, you may be interested in building upon work that I have already done in a different thread that counts business days (based upon a user-defined calendar) and incorporate that into your custom tailored table solution. http://emacs.stackexchange.com/a/7118/2287 The project will require some intermediate `elisp` to modify it to your specific needs. `Calc` also has something built in that utilizes the generic holiday schedule that you may be interested in. – lawlist Jul 22 '15 at 21:48
  • 2
    Another function the original poster may be interested in taking a look at is `calendar-count-days-region`: http://www.gnu.org/software/emacs/manual/html_node/emacs/Counting-Days.html That function can also be modified to help write the solution to this custom table issue. – lawlist Jul 22 '15 at 21:55

0 Answers0