Cashflow
Details
- TimeValue[Cashflow[…],interest,t] computes the time value of a cash flow as a single equivalent payment at the specified time t. Possible cash flow calculations include net present value, discounted cash flow, and internal rate of return.
- Times and amounts can be given as numbers or arbitrary symbolic expressions.
- In Cashflow[{{time1,c1},…}], the timei can be given as numerical values or date expressions.
- Cashflow[{c0,c1,c2,…}] is equivalent to Cashflow[{{0,c0},{1,c1},{2,c2},…}].
- TimeValue[Cashflow[{{date0,c0},…}],r,date] computes the time value of a cash flow at date.
- Cashflow[Annuity[…]] converts an Annuity object to a Cashflow object.
Examples
open all close allBasic Examples (4)
Compute the present value at 7% of a stream of cash flows occurring at regular time intervals:
TimeValue[Cashflow[{0, 100, 250, 300, 200, 500}], .07, 0]Specify an interval at which cash flows occur:
TimeValue[Cashflow[{50, 100, 250, 300}, 1 / 2], r, 0]Future value at 9% of a stream of cash flows occurring at irregular time intervals:
TimeValue[Cashflow[{{2, 100}, {5, 200}, {7.5, 200}, {10, 500}}], .09, 10]Find the net present value of a $1000 initial investment producing future incoming cash flows:
TimeValue[Cashflow[{-1000, 100, 200, 300, 400, 500}], .07, 0]Scope (6)
Convert an Annuity object to a Cashflow object:
Cashflow[Annuity[100 #&, 6]]Cashflow works with date expressions:
TimeValue[Cashflow[{{{2010, 1, 1}, -600}, {{2011, 1, 1}, 300}, {{2012, 1, 1}, 400}}], .08, {2009, 1, 1}]Specify Cashflow with a TimeSeries:
cf = Cashflow[TemporalData[TimeSeries, {{{0.04, 0.05, 0.06, 0.07, 0.08}}, {{0, 4, 1}}, 1, {"Continuous", 1},
{"Discrete", 1}, 1, {ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, False,
10.1]];TimeValue[cf, 3]Cashflow works with symbolic parameters:
TimeValue[Cashflow[{c1, c2, c3, c4}], r, t]TimeValue[Cashflow[{c1, c2, c3, c4}, 1 / f], r, t]TimeValue[Cashflow[{{p1, c1}, {p2, c2}, {p3, c3}}], r, t]Cashflow[Annuity[pmt + g (# - 1)&, 10]]Solutions to equations involving Cashflow can be found in terms of symbolic parameters:
Solve[TimeValue[Cashflow[{c0, c1, c2, c3}], r, n] == val, c3]Calculate the duration of a series of cash flows using the derivative function D:
val = TimeValue[Cashflow[{100, 100, 300, 300, 400, 400, 500}], r, 0]duration = (-(1 + r)/val)D[val, r]duration /. r -> .05Applications (6)
Internal rate of return of an investment with regular cash flows:
FindRoot[ TimeValue[Cashflow[{-1000, 100, 200, 300, 400, 500}], r, 0] == 0, {r, .05}]Find the payment at time 2 that will make the net present value of a series of cash flows zero:
Solve[TimeValue[Cashflow[{-1000, 300, pmt, 250, 500}], .08, 0] == 0, pmt]Solve for the point in time where a payment of $400 will make the net present value equal to 0:
Solve[TimeValue[Cashflow[{{0, -1000}, {2, 300}, {t, 400}, {5, 600}}], .08, 0] == 0, t]//QuietIn return for receiving $600 at the end of 8 years, a person pays $100 immediately, $200 at the end of 5 years and a final payment at the end of 10 years. Find the final payment amount that will make the rate of return on the investment equal to 8% compounded semiannually:
Solve[TimeValue[Cashflow[{{0, -100}, {5, -200}, {8, 600}, {10, pmt}}], EffectiveInterest[.08, 1 / 2], 0] == 0, pmt]Payments of $100, $200 and $500 are due at the end of years 2, 3 and 8, respectively. Find the point in time where a payment of $800 would be equivalent at 5% interest:
Solve[TimeValue[Cashflow[{{2, 100}, {3, 200}, {8, 500}}], .05, t] == 800, t]//QuietFind the effective rate of interest at which the present value of $2000 at the end of 2 years and $3000 at the end of 4 years will be equal to $4000:
FindRoot[TimeValue[Cashflow[{{2, 2000}, {4, 3000}}], r, 0] == 4000 , {r, .05}]Properties & Relations (3)
A Cashflow object with one cash flow is equivalent to a simple amount:
TimeValue[Cashflow[{{5, 100}}], r, 0]TimeValue[100, r, -5]Large cash flow sequences that obey a pattern can be generated through Annuity using a payment growth function:
Cashflow[Annuity[100 (1 + g)^2# - 1&, 5, 1 / 2]]Large cash flow streams can also be created using Table:
Cashflow[Table[{i / 2, 100Mod[i, 5]}, {i, 1, 30}]]Use Plot and Plot3D to explore the various dependencies a series of cash flows has on a set of variables:
g1 = TimeValue[Cashflow[{pmt, (1 + g) pmt, (1 + g)^2 pmt, (1 + g)^3 pmt, (1 + g)^4 pmt}], r, n]Plot[g1 /. {pmt -> 100, n -> 10, g -> .1}, {r, .01, .15}, AxesLabel -> {"interest", "value"}, ImageSize -> 250]Dependence on payment growth rate:
Plot[g1 /. {pmt -> 150, n -> 10, r -> .07}, {g, -.2, .2}, AxesLabel -> {"payment growth rate", "value"}, ImageSize -> 300]Use Plot3D to view the interest rate/growth rate landscape:
Plot3D[g1 /. {pmt -> 100, n -> 10}, {r, .01, .15}, {g, -.2, .2}, AxesLabel -> {"interest", "growth", "value"}, ImageSize -> 250]Possible Issues (2)
When specifying a valuation period in between payments of a Cashflow object, TimeValue calculates the future value of all cash flows before the valuation period, and the present value of all cash flows after the valuation period:
TimeValue[Cashflow[{{1, 100}, {2, 200}, {3, 300}, {4, 400}}], .08, 2.5]This is equivalent to the sum of present and future values here:
TimeValue[Cashflow[{{1, 100}, {2, 200}}], .08, 2.5] + TimeValue[Cashflow[{{3, 300}, {4, 400}}], .08, 2.5]Cashflow[Annuity[pmt,n,q]] only works for numeric n and f:
Cashflow[Annuity[pmt, n]]Using numeric n allows Cashflow to convert the Annuity object as desired:
Cashflow[Annuity[pmt, 5]]Interactive Examples (1)
Use Manipulate to explore the various dependencies a series of cash flows has on a set of variables:
Manipulate[
Plot[
Evaluate[
TimeValue[Cashflow[{pmt, 100 + pmt, 200 + pmt, 300 + pmt, 400 + pmt, 500 + pmt, 600 + pmt, 700 + pmt, 800 + pmt, 900 + pmt}], EffectiveInterest[r, 1 / c], n]
],
{n, 5, 30}, AxesLabel -> {"time", "value"}
],
{{pmt, 150, "payment"}, 100, 300}, {{r, .05, "interest"}, .01, .15}, {{c, 2, "compounding"}, 1, 10}, FrameLabel -> "future value of an annuity"
]Neat Examples (1)
Plot the cash flows in a "sawtooth"-style cash flow stream together with the accumulated value as a function of time:
cfspecs = Table[{i, 100 * (-1)^Floor[i, 5]Mod[i, 5]}, {i, 1, 30}];g1 = ListPlot[cfspecs, Filling -> Axis, AspectRatio -> 1 / 2, ImageSize -> 400]totalval = Table[{cfspecs[[i, 1]], TimeValue[Cashflow[cfspecs[[1 ;; i]]], .05, cfspecs[[i, 1]]]}, {i, 1, Length[cfspecs]}];g2 = ListLinePlot[totalval, PlotStyle -> {Thickness[.004], Orange}, InterpolationOrder -> 3];Show[{g1, g2}, PlotRange -> All]Related Guides
History
Text
Wolfram Research (2010), Cashflow, Wolfram Language function, https://reference.wolfram.com/language/ref/Cashflow.html.
CMS
Wolfram Language. 2010. "Cashflow." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Cashflow.html.
APA
Wolfram Language. (2010). Cashflow. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Cashflow.html
BibTeX
@misc{reference.wolfram_2026_cashflow, author="Wolfram Research", title="{Cashflow}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/Cashflow.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_cashflow, organization={Wolfram Research}, title={Cashflow}, year={2010}, url={https://reference.wolfram.com/language/ref/Cashflow.html}, note=[Accessed: 13-June-2026]}