跳到主要内容

WORKDAY_INTL

Returns the serial number of the date before or after a specified number of workdays with custom weekend parameters.

Syntax

expression.WORKDAY_INTL(arg1, arg2, arg3, arg4);

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 | stringA number or string specifying when weekends occur.
arg4OptionalApiRange | 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

This example shows how to return the serial number of the date before or after a specified number of workdays with custom weekend parameters.

// How to return the serial number of the date adding some workdays.

// Use a function to calculate the serial number of the date.

const worksheet = Api.GetActiveSheet();

let func = Api.GetWorksheetFunction();
let ans = func.WORKDAY_INTL("9/8/2017", "-20", "0000011", "8/15/2017");

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