Sounds like the question you really want to ask is "how do I count the number of weekdays between Date1 and Date2?
| eval Day1=strftime(Date1,"%w")
| eval Day2=strftime(Date2,"%w")
| eval DaysBetween = (5*floor((Date2-Date1)/86400/7))+if(Day1<Day2,Day2-Day1,5+Day2-Day1)
This translates as 1-2) tell me what day of the week 0-7 each day is,
3) Calculate 5 days for each full 7 days, plus the difference between the start and end days, adding 5 if the end day is earlier in the week than the start day.
I'm assuming that you are NOT counting both days, so for example the number of days between Tuesday and Thursday is 2. If you want that to be 3 instead, then add 1 more.
I'm also assuming that the endpoints will never be on weekends, and you don't care about holidays. If those aren't true, it will have to be a lot more complex.
... View more