跳到主要内容

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

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberA serial date number that represents the start date.
arg2RequiredApiRange | ApiName | numberThe 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.
arg3OptionalApiRange | 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

const worksheet = Api.GetActiveSheet();

let func = Api.GetWorksheetFunction();
let ans = func.WORKDAY("12/7/1981", 56);

worksheet.GetRange("C1").SetValue(ans);