Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel中分组循环CF的净现值_Excel_Excel Formula - Fatal编程技术网

Excel中分组循环CF的净现值

Excel中分组循环CF的净现值,excel,excel-formula,Excel,Excel Formula,以下是60个期间的现金流量表 存在一组经常性现金流。excel中是否有一种简单的方法来计算所有60个期间(每月现金流)的净现值,而不必创建一个60行的表格并使用净现值公式 因此,60行项目的公式如下: =NPV(周期率,CF 1-60的值)+CF0 但是,如果您知道excel中存在重复的现金流,并且不必枚举所有60行,那么您可以设置快捷方式吗 提前谢谢 没有内置函数可以实现这一点,但我们可以构建自己的函数。这是一个UDF(用户定义函数): 这有三个标准:每个数量的比率、范围和相应的次数 您可以使

以下是60个期间的现金流量表

存在一组经常性现金流。excel中是否有一种简单的方法来计算所有60个期间(每月现金流)的净现值,而不必创建一个60行的表格并使用净现值公式

因此,60行项目的公式如下:

=NPV(周期率,CF 1-60的值)+CF0

但是,如果您知道excel中存在重复的现金流,并且不必枚举所有60行,那么您可以设置快捷方式吗

提前谢谢


没有内置函数可以实现这一点,但我们可以构建自己的函数。这是一个UDF(用户定义函数):

这有三个标准:每个数量的比率、范围和相应的次数


您可以使用年金公式

D1
中,使用
=1/($B$7/12)*(1-1/(1+$B$7/12)^C1)*B1*1/(1+$B$7/12)^(总和($C$1:C1)-12)
并复制下来


谢谢。你能把你使用的金融公式和变量一起打印出来,解释并给出金融背景吗?
Function myNPV(rate As Double, vl As Range, times As Range)
If vl.Cells.Count <> times.Cells.Count Then Exit Function
Dim vlArr() As Variant
Dim timesArr() As Variant
Dim ovlArr() As Double
Dim i&, j&, t&, cnt&

vlArr = vl.Value
timesArr = times.Value
For i = LBound(vlArr, 1) To UBound(vlArr, 1)
    If vlArr(i, 1) <> "" Then
        t = t + timesArr(i, 1)
    End If
Next i
cnt = 1
ReDim ovlArr(1 To t)
For i = LBound(vlArr, 1) To UBound(vlArr, 1)
    If vlArr(i, 1) <> "" Then
        For j = 1 To timesArr(i, 1)
            ovlArr(cnt) = vlArr(i, 1)
            cnt = cnt + 1
        Next j
    End If
Next i

myNPV = Application.WorksheetFunction.NPV(rate, ovlArr)

End Function
=myNPV(C20/C19,B3:B17,C3:C17)+B2