Skip to main content

PDURATION

Returns the number of periods required by an investment to reach a specified value.

Syntax

expression.PDURATION(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe interest rate per period.
arg2RequiredApiRange | ApiName | numberThe present value of the investment.
arg3RequiredApiRange | ApiName | numberThe desired future value of the investment.

Returns

number

Example

Calculate how many periods an investment needs to reach a target amount in a spreadsheet.

// How do I find the time required for an investment to grow to a specific value in a spreadsheet?

// Determine the number of investment periods until a desired return is achieved in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.PDURATION("2.50%", 2000, 2200));