Excel VBA APR 公式

Excel VBA formula for APR

如何计算年百分比率 (APR),给出以下条件:

A - 年初借入的贷款 (USD 1000),
B - 借款人等额支付的贷款最终成本总和(2000美元),
c - 每年的复利期数(52 周),
k - 偿还贷款的期数(60 周)

文献中的所有公式都使用名义利率(还有ExcelEffective函数)但我们这里没有这个参数。

APR 我的意思是:http://en.wikipedia.org/wiki/Annual_percentage_rate

我构建了一个电子表格,我可以通过更改 名义利率 使用 Excel Solver 找到 APR。难道没有更优雅的解决方案吗?

这似乎是一个不切实际的场景,但可以弄清楚。我相信有更简单的方法可以做到这一点,但您可以使用 =PMT 公式返回它。

https://www.youtube.com/watch?v=MXf0HU-JQ1Q

下载此 YouTube 视频中包含的文件并更新您的价值观。现在使用虚拟 APR 作为插头。删除 60 个周期后的所有行和 sum 已付利息列。您正在寻找这样一种情况,在这种情况下,您支付了 1,000.00 的利息,考虑到贷款是 1,000,并且您说您以等额付款总共支付了 2,000.00。所以你需要 60 个周期的 Intest 总和应该是 1,000。

从那里您可以开始调整 APR,注意在您达到目标之前支付的利息总额。我得出的 136.87% 是不现实的,但正如我所说,除非我读错了,否则你的情况似乎很不现实。

这是 APR 的代码。对于优化搜索机制和我分配给变量的类型(双精度、整数)的任何评论,我将不胜感激。

宏的想法是将名义利率(i)从1%开始增加一个非常小的值(step) 只要它能让我们更接近正确计算 等额分期支付的贷款总成本 (B).

Function APR(A As Double, B As Double, c As Integer, k As Integer, Optional i As Double = 0.01, Optional step As Double = 0.0001) As Double
'Author Przemyslaw Remin, thanks for explanation to Chris Degnen
'
'A - Loan amount we borrow
'B - Total amount we pay back in equal installments in k periods
'c - Number of compoundings per year
'k - Number of periodic payments
'i - Nominal interest rate, here it will be used as iterator to find correct B
'step - how much we change i, the smaller the step the more precision we get
'
Dim target1 As Double
Dim target2 As Double

Do Until target1 < target2 'we do the loop until the target falls
    target1 = ((i / c) / (1 - (1 + i / c) ^ (-k)) - (B / (k * A))) ^ 2
    i = i + step
    target2 = (((i + step) / c) / (1 - (1 + (i + step) / c) ^ (-k)) - (B / (k * A))) ^ 2
Loop

APR = (1 + i / c) ^ c - 1
End Function

感谢 Chris Degnen 对此处提供的 APR 计算机制的友好解释:https://money.stackexchange.com/questions/43450/how-to-calculate-annual-percentage-rate?noredirect=1#comment64347_43450

这是对 OP 解决方案的修改:

首先,确保B>A;即有正利率

然后,假设利率低得离谱:比如说,0.000000000001%

将其与年金公式中的其他数据一起使用,以计算根据该假设利率预期的定期付款。计算出的付款将小于问题中指定的付款,因为真实利率高于假设的利率。

将假设利率加倍并重复上一步。最终,计算出的付款将超过给定的付款。您现在的当前假设利率太大,而之前的假设利率太小。

在这两个值之间进行二分查找,直到过高率和过低率收敛到所需的程度...