User Tools

Site Tools


syntax:functions:workdays

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
syntax:functions:workdays [2024/01/20 11:41] – [Remarks] dmitrysyntax:functions:workdays [2025/05/15 14:48] (current) – add exclusion/inclusion feature craigt
Line 1: Line 1:
-======Workdays(from_date, to_date) ======+======Workdays(from_date, to_date, [exclude],[include]) ======
 Category:  Date and Time function Category:  Date and Time function
  
Line 10: Line 10:
 |from_date|Date or Number (date serial)|An expression representing the first date value to derive the number of workdays from.| |from_date|Date or Number (date serial)|An expression representing the first date value to derive the number of workdays from.|
 |to_date|Date or Number (date serial)|An expression representing the second date value to derive the number of workdays from.| |to_date|Date or Number (date serial)|An expression representing the second date value to derive the number of workdays from.|
 +|exclude|Text|(Optional) Dates to exclude from the calculation.  This argument should appear as a list of comma-separated dates in text format, enclosed in quotes (i.e., "2020-11-26, 2020-04-24").|
 +|include|Text|(Optional) Dates to include in the calculation.  This argument should appear as a list of comma-separated dates in text format, enclosed in quotes (i.e., "2020-08-15, 2020-03-22").|
  
 **Return value type:** Number **Return value type:** Number
Line 19: Line 21:
   * A date serial value: 43811 (the date serial for "2019-12-12")   * A date serial value: 43811 (the date serial for "2019-12-12")
   * A date value created using any of the Date/Time functions that returns a date serial value.   * A date value created using any of the Date/Time functions that returns a date serial value.
 +
 +The //exclude// and //include// arguments need to be a date or list of dates, delimited by commas, enclosed in quotes, and appearing in yyyy-MM-dd format:
 +  * A single date: "2024-02-20"
 +  * List of 3 dates: "2023-04-01, 2023-07-22, 2023-10-31"
 +  * Use empty quotes ("") in the //exclude_dates// position if no dates will be excluded, but there are dates to be //included// See the last Example below.
 +  * A date serial value cannot be used (i.e., "43811").
  
 \\  \\ 
Line 28: Line 36:
  
   workdays(#2005-12-17, #2005-12-18)  //Returns 0 (The 17th is a Sat and the 18th is a Sun.)   workdays(#2005-12-17, #2005-12-18)  //Returns 0 (The 17th is a Sat and the 18th is a Sun.)
 +
 +  workdays(#2019-01-01,#2019-12-31,"2019-07-13","2019-07-26" //Returns 261 (1 exclusion, 1 inclusion.)
 +
 +  workdays(#2019-01-01,#2019-12-31,"2019-05-24,2019-06-28" //Returns 259 (2 exclusions.)
 +
 +  workdays(#2019-01-01,#2019-12-31,"","2019-06-29" //Returns 262. (No exclusions, one inclusion.)
 +  
  
syntax/functions/workdays.txt · Last modified: 2025/05/15 14:48 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki