CF_SumRange function

Actuarial Excel Addin

The CF_SumRange function adds the yearly cash flows between two selected years. It is intended for use with the spilled yearly output returned by JS, JL when the optional argument cash_flow is set to a non-zero value or with the spilled vector produced by CF_SumByYear.

* : Required parameter

Parameters
Default
Description
cash_flow *
--
Yearly cash-flow vector, usually obtained from a spilled JS(..., cash_flow<>0) or JL(..., cash_flow<>0) result.
start_year
1
First policy year included in the total. Policy year 1 corresponds to the first value of the yearly cash-flow vector.
end_year
120
Last policy year included in the total, inclusive. If omitted, the function sums to the end of the available vector.

Example
Result
CF_SumRange(A2#, 1, 5)
Returns the total of policy years 1 to 5 from the spilled cash-flow range in A2#.
CF_SumRange(JS(65, B2#, {0.03}, cash_flow=1), 6, 10)
Calculates a yearly cash-flow vector and immediately returns the total for policy years 6 to 10.
CF_SumRange(C2#, 3)
Returns the total from policy year 3 to the end of the available yearly cash-flow vector.

Notes
Description
Inclusive limits
Both start_year and end_year are included in the calculation.
Out-of-range years
Years before 1 are treated as 1, and years beyond the available vector are ignored.
Empty vector
If the supplied cash-flow vector is empty, the function returns 0.
Typical use
This helper is useful when a spreadsheet needs the total cash flow over a limited period without building a separate SUM formula around the spilled range.
Invalid input
If the supplied argument cannot be interpreted as numeric yearly cash flows, the function returns an Excel value error.