Skip to main content

YIELDDISC

Returns the annual yield for a discounted security. For example, a Treasury bill.

Syntax

expression.YIELDDISC(arg1, arg2, arg3, arg4, arg5);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe settlement date of the Treasury bill, expressed as a serial date number.
arg2RequiredApiRange | ApiName | numberThe maturity date of the Treasury bill, expressed as a serial date number.
arg3RequiredApiRange | ApiName | numberThe purchase price of the security, per $100 par value.
arg4RequiredApiRange | ApiName | numberThe redemption value of the security, per $100 par value.
arg5OptionalApiRange | ApiName | numberThe day count basis to use: 0 or omitted - US (NASD) 30/360; 1 - Actual/actual; 2 - Actual/360; 3 - Actual/365; 4 - European 30/360.

Returns

number

Example

This example shows how to return the annual yield for a discounted security. For example, a Treasury bill.

// How to return an annual yield for a discounted security.

// Use a function to get an annual yield.

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.YIELDDISC("1/10/2018", "11/20/2019", 90, 100));