跳到主要内容

YIELD

返回定期支付利息的有价证券的收益率。

语法

expression.YIELD(arg1, arg2, arg3, arg4, arg5, arg6, arg7);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number国库券的结算日期,以序列日期数字表示。
arg2必需ApiRange | ApiName | number国库券的到期日,以序列日期数字表示。
arg3必需ApiRange | ApiName | number证券的年票面利率。
arg4必需ApiRange | ApiName | number证券的购买价格,按每 100 美元面值计。
arg5必需ApiRange | ApiName | number证券的赎回价值,按每 100 美元面值计。
arg6必需ApiRange | ApiName | number每年的付息次数。可能的值为:1 表示年付、2 表示半年付、4 表示季付。
arg7可选ApiRange | ApiName | number要使用的日计数基准:0 或省略 - 美国 (NASD) 30/360;1 - 实际/实际;2 - 实际/360;3 - 实际/365;4 - 欧洲 30/360。

返回值

number

示例

此示例演示如何返回定期付息证券的收益率。

// How to return the yield on a security.

// Use a function to calculate the yield on a security that pays periodic interest.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.YIELD("1/10/2018", "11/20/2019", "3.75%", 90, 100, 4));