# Functions for financial calculations

These functions perform financial calculation on numeric values, and return the result. You can use these to make calculations in imports, reports, or models.

#### ACCRUE

Returns the given value if the given period falls within the given from-to periods. Optionally, return the newvalue if the given period is beyond the newper period.

This function is useful for (example) applying salaries to a range of periods, or accruing revenue or expense amounts over a range of periods.

ACCRUE(value, period, from, to, newper, newvalue)

Example:
ACCRUE(1000, 4, 3, 10) returns 1000

#### COMPOUND

Calculates the sum of the given amount and compounded interest over that amount at the given annual interest rate over the given number of years. Interest is compounded at the end of every year.

This function is useful for simple long-term calculations using a constant interest rate. For calculations with varying rates, you can use FVSCHEDULE.

COMPOUND(data, rate, years)

Example:
COMPOUND(1000, 0.05, 4) returns 1215.50625

#### DEPRECIATE

Calculates the total depreciation amount for the given from-to period, based on the asset cost value, residual value, the total number of periods, and the depreciation type. If you omit the "to" period, the depreciation will be calculated for the "from" period.

DEPRECIATE(cost, rest, periods, from, to, type)

Type:
0 = straight line (default)
1 = declining balances
2 = double declining balances

Examples:
DEPRECIATE(3700, 100, 36, 1) returns 100
DEPRECIATE(3700, 100, 36, 1, 12) returns 1200
DEPRECIATE(3700, 100, 36, 9, 12) returns 300
DEPRECIATE(3700, 100, 36, 1, 12, 1) returns 1134.60

#### EFFECT

Calculates the effective annual interest rate, given the nominal annual interest rate and the number of compounding periods per year.

EFFECT(rate, periods)

Example:
data = 0.0585
EFFECT(data, 12) returns 6

#### FORECAST

Calculates an intersecting or future value by analyzing the linear regression trend in the given cell range or data array. The "data" should contain historic (or otherwise referential) data for a number of periods. The "index" parameter indicates the period that you want to forecast. If "index" is higher than the number of periods in the data, the result will be the forecasted future value for that given period. If "index" is smaller than the number of periods in the data, the result will be the intersecting value at that given period.

FORECAST(data, index)

Example:
data = [10, 20, 30, 40, 50, 60]
FORECAST(data, 3) returns 30 (intersecting value)

data = [10, 20, 30, 40, 50, 60]
FORECAST(data, 9) returns 90 (future value)

#### FV

Calculates the future value of an investment, based on a constant interest rate. You can use FV with either periodic or constant payments, or one single payment. The "payment" is the periodic payment (negative) or income (positive), and "value" is the optional present value.

FV(rate, periods, payment, value, type)

Type:
0 = end of period
1 = start of period

Example:
data = 0.06
FV(data / 12, 10, -200, -500, 1) returns 2581.40

#### FVSCHEDULE

Calculates the sum of the given amount and compounded interest using a schedule of annual interest rates, one for each year. Interest is compounded at the end of every year. The "rates" parameter should be a cell range or data array with interest rates.

For simpler long-term calculations using a constant interest rate, you can use COMPOUND.

FVSCHEDULE(data, rates)

Example:
A1:A5 = 0.04, 0.04, 0.05, 0.05, 0.06
FVSCHEDULE(1000, A1:A5) returns 1264.01

#### NOMINAL

Calculates the nominal annual interest rate, given the effective rate and the number of compounding periods per year. NOMINAL is the reverse of EFFECT.

NOMINAL(rate, periods)

Example:
data = 0.06
NOMINAL(data, 12) returns 0.0585

#### NPV

Calculates the net present value of an investment, based on a constant interest rate and a series of future periodic payments (negative values) and/or periodic income (positive values). NPV is similar to the PV function (present value). The primary difference between PV and NPV is that NPV allows for varying periodic payments.

NPV(rate, payments)

Example:
data = 0.06
NPV(0.06 / 12, -200, -250, -300, 100, 90) returns -556.26

#### PV

Calculates the present value of an investment, based on a constant interest rate. You can use PV with either periodic or constant payments, or a future value. The "payment" is the periodic payment (negative) or income (positive), and "value" is the optional future value.

PV(rate, periods, payment, value, type)

Type:
0 = end of period (default)
1 = start of period

Example:
data = 0.06
PV(data / 12, 10, -200, -500, 1) returns 2431.49

#### RRI

Calculates the equivalent interest rate for the growth of an investment from present to future over the given number of periods.

RRI(periods, present, future)

Example:
RRI(12, 1000, 1100) returns 0.00797