WORKDAY
Returns the serial number of the date before or after a specified number of workdays.
Syntax
expression.WORKDAY(arg1, arg2, arg3);
expression
- A variable that represents a ApiWorksheetFunction class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
arg1 | Required | ApiRange | ApiName | number | A serial date number that represents the start date. | |
arg2 | Required | ApiRange | ApiName | number | The number of nonweekend and non-holiday days before or after the start date. A positive value for days yields a future date; a negative value yields a past date. | |
arg3 | Optional | ApiRange | ApiName | number[] | An optional range or array of one or more serial date numbers to exclude from the working calendar, such as state and federal holidays and floating holidays. |
Returns
number
Example
- Code
- Result
const worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
let ans = func.WORKDAY("12/7/1981", 56);
worksheet.GetRange("C1").SetValue(ans);