Skip to main content
These functions cover the time value of money, amortization, and cash-flow analysis.

Conventions

Across all of them:
  • Cash inflows are positive and outflows are negative.
  • Interest rates are entered and returned as decimals (0.08, not 8%).
  • periods_per_year and compounds_per_year default to 12; a value less than 1 returns a Parameter out of range error.
  • beginning_of_period is false for end-of-period (the default) or true for beginning-of-period.

Value and period units

The time-value-of-money and amortization functions accept units on their value and period arguments, with these rules:
  • Valuespresent_value, future_value, and payment may each be a currency value (375000 USD) or a plain scalar (375000). Within a single call they must all be the same kind. A value of 0 is the exception: it is accepted for any of these arguments regardless of the others.
  • Periodsperiods may be a time value (30 yr) or a scalar. A time value is converted to a number of periods by converting it to years and multiplying by periods_per_year. A scalar is used as the number of periods unchanged.
  • Solving for periods — when periods() solves for the number of periods, its return type mirrors the value arguments. If present_value, future_value, and payment are currency values, the result is a time value in years (the period count divided by periods_per_year). If they are scalars, the result is a bare scalar count of periods. See periods.

Time value of money

The five core functions each solve for one variable given the others. Each accepts the optional tail periods_per_year; compounds_per_year; beginning_of_period. periods of 0 returns a result of 0.

Present value [pv]

Follows the shared conventions and value and period units.

Future value [fv]

Follows the shared conventions and value and period units.

Payment [pmt]

Follows the shared conventions and value and period units.

Interest rate [rate]

Returns the interest rate as a decimal. Follows the shared conventions and value and period units.

Number of periods [periods]

Follows the shared conventions and value and period units. The return type mirrors the present value, future value, and payment arguments. With scalar values, periods() returns a bare scalar count. With currency values, it returns a time value in years — the period count divided by periods_per_year — because the result carries the period unit rather than a dimensionless count.
These are equivalent results: with periods_per_year at its default of 12, the first call returns the count in periods (months) and the second returns it in years (94.2355 periods / 12 periods per year = 7.853 yr). To recover a scalar count from a currency-valued call, convert the result to the unit that matches one period and strip it with unitvalue. At the default of 12 periods per year, one period is a month, so convert to "mo":
This "mo" form is exact only because periods_per_year is 12. For any other cadence, recover the count by converting to years and multiplying by periods_per_yearunitvalue(periods(...); "yr") * periods_per_year — which holds regardless of how many periods fall in a year. Recovering the count matters when a downstream calculation multiplies it by a currency amount: a yr-typed count raises input.incompatible_units (“Cannot multiply Currency and Time”), while the recovered scalar count multiplies cleanly.

Amortization

These analyze a loan or investment over its schedule. They follow the same value and period unit rules as the functions above, and the begin and end arguments follow the same rule as periods — a time value is converted to periods, a scalar is used unchanged. In addition, a fractional begin or end is reduced to its integer part (1.51, 11.311). Each function also accepts a final positive_result argument: set it to true to always report the result as a positive number. periods of 0 returns 0 (or, for amortization, an empty table).

End balance [endbal]

The balance remaining at the end of period end. Follows the shared conventions and value and period units; see Amortization for the period and positive_result rules.

Principal paid [prnpaid]

The total principal paid from period begin to period end, inclusive. Follows the shared conventions and value and period units; see Amortization for the period and positive_result rules.

Interest paid [intpaid]

The total interest paid from period begin to period end, inclusive. Follows the shared conventions and value and period units; see Amortization for the period and positive_result rules.

Amortization table [amortization]

A table of amortization results for each period from begin to end, inclusive. Each row is one period; its four columns are, in order, the payment, the principal paid, the interest paid, and the end balance. To chart how a payment splits between principal and interest across the schedule, slice those two columns with columns: columns(schedule; 2; 3) returns a two-column table ready to show as a bar chart. A single column is taken the same way — column(schedule; 4) is the end-balance curve. Follows the shared conventions and value and period units; see Amortization for the period and positive_result rules.

Uniform and single payment series

These take an interest_rate per compounding period and a number of periods. uspv() calculates the present value of a series of 1paymentswhileusfv()calculatesthefuturevalueofaseriesof1 payments while `usfv()` calculates the future value of a series of 1 payments. sppv() calculates the present value of 1whilespfv()calculatesthefuturevalueof1 while `spfv()` calculates the future value of 1. Because the rate is per period, divide an annual rate by the number of compounding periods per year — for a 6% annual rate compounding monthly, pass 0.06 / 12. The rate is a decimal, so you can also write it as rate / 100 or rate%.

Interest rate conversion

effrate converts a nominal rate to an effective annual rate; nomrate does the reverse. A compounds_per_year of 0 denotes continuous compounding; a negative value returns a Parameter out of range error. Both take and return decimals.

Cash flow analysis

Each takes a table of cash flows (inflows positive, outflows negative). For npv, nfv, nus, mirr, and profindex, the rate is annual by default — divide it by the number of compounding periods per year to use a periodic rate.
irr finds the rate at which the cash flows’ net present value is zero. A meaningful result requires the cash flows to change sign at least once; when they change sign more than once, more than one rate can satisfy NPV = 0. mirr takes a finance interest_rate and a reinvestment risk_rate.