Skip to main content

DAYS360

Returns the number of days between two dates based on a 360-day year (twelve 30-day months).

Syntax

expression.DAYS360(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberStart date from which days will be counted.
arg2RequiredApiRange | ApiName | numberEnd date until which days will be counted.
arg3OptionalApiRange | ApiName | booleanA logical value that specifies whether to use the U.S. (NASD) (false or omitted) or European (true) method in the calculation. According to the European method, the start and end dates that occur on the 31st of a month become equal to the 30th of the same month. According to the U.S. method, the start date is the last day of a month, it becomes equal to the 30th of the same month. If the end date is the last day of a month and the start date is earlier than the 30th of a month, the end date becomes equal to the 1st of the next month. Otherwise the end date becomes equal to the 30th of the same month.

Returns

number

Example

Calculate days between two dates using a 360-day year in a spreadsheet.

// What is the total days between two specific dates using 360-day year in a spreadsheet?

// Count the number of days from one date to another with 360-day months in a spreadsheet.

const worksheet = Api.GetActiveSheet();

let func = Api.WorksheetFunction;
let ans = func.DAYS360("3/31/2018", "4/30/2019", false);

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