Skip to main content

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

Calculate a workday date with custom weekend definitions in a spreadsheet.

// How do I find a date by counting workdays with a custom weekend schedule in a spreadsheet?

// Determine a target date based on workdays using custom weekend parameters in a spreadsheet.

const worksheet = Api.GetActiveSheet();

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

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