This page is part of the Calculated Fields Form's documentation (a WordPress Plugin). The Financial Module is part of the Developer Version of the Calculated Fields Form.

Financial Module

The module includes a pack of functions to improve the implementation of financial equations.

Operation Description Demo
CALCULATEPAYMENT(x,y,z)

Calculate the Financed Payment Amount
Three parameters: amount, months, interest rate (percent)

Ex: CALCULATEPAYMENT(25000, 60, 5.25)
Result: 474.65

CALCULATEAMOUNT(x,y,z)

Calculate the Financed Amount
Three parameters: months, interest rate (percent), payment

Ex: CALCULATEAMOUNT(60, 5.25, 474.65)
Result: 25000.02

CALCULATEMONTHS(x,y,z)

Calculate the Months Financed
Three parameters: amount, interest rate (percent), payment

Ex: CALCULATEMONTHS(25000, 5.25, 474.65)
Result: 60

CALCULATEINTEREST(x,y,z)

Calculate the Financed Interest Rate
Three parameters: amount, months, payment

Ex: CALCULATEINTEREST(25000, 60, 474.65)
Result: 5.25

CALCULATEACCRUEDINTEREST(x,y,z)

Calculate the Accrued Interest
If your money is in a bank account accruing interest, how much does it earn over x months? Three parameters: principle amount, months, interest rate (percent)

Ex: CALCULATEACCRUEDINTEREST(25000, 60, 5.25)
Result: 7485.806648756854

CALCULATEAMORTIZATION(x,y,z,date)

Create Amortization Schedule
Create an amortization schedule. The result should be an array the length the number of months. Each entry is an object. Four parameters: principle amount, months, interest rate (percent), start date (optional Date object)

Ex: CALCULATEAMORTIZATION(25000, 60, 5.25, new Date(2011,11,20) )
Result: 


principle: 24634.725 
interest: 109.375 
payment: 474.65 
paymentToPrinciple: 365.275 
paymentToInterest: 109.375 
date: Tue Dec 20 2011 00:00:00 GMT+0100 (Romance Daylight Time) 
}, 

principle: 24267.851921874997 
interest: 217.151921875 
payment: 474.65 
paymentToPrinciple: 366.873078125 
paymentToInterest: 107.776921875 
date: Fri Jan 20 2012 00:00:00 GMT+0100 (Romance Daylight Time) 
}, 
... 
]

PRESENTVALUE(x,y,z)

Returns the present value of an investment
The present value is the total amount that a series of future payments is worth now. Three parameters: The interest rate per period, the total number of payment periods in an annuity, the payment made each period and cannot change over the life of the annuity

Ex: PRESENTVALUE(0.08,5,100)
Result: 399.27

FUTUREVALUE(v,w,x,y,z)

Returns an investment based on an interest rate and a constant payment schedule. Five parameters: The interest rate for the investment, the number of payments for the annuity, the amount of the payment made each period, the present value of the payments (if this parameter is omitted, it assumes to be 0), parameter that indicates when the payments are due (if this parameter is omitted, it assumes to be 0. The possible values are: 0 - Payments are due at the end of the period, 1 - Payments are due at the beginning of the period)

Ex: FUTUREVALUE(7.5/12,24,-250,-5000,1)

PMT(Rate,NPer,PV,FV,TYPE)

Returns the periodic payment for an annuity with constant interest rates

Rate is the periodic interest rate.
NPer is the number of periods in which annuity is paid.
PV is the present value (cash value) in a sequence of payments.
FV (optional) is the desired value (future value) to be reached at the end of the periodic payments.
Type (optional) is the due date for the periodic payments. Type=1 is payment at the beginning and Type=0 is payment at the end of each period.
In the LibreOffice Calc functions, parameters marked as optional can be left out only when no parameter follows. For example, in a function with four parameters, where the last two parameters are marked as optional, you can leave out parameter 4 or parameters 3 and 4, but you cannot leave out parameter 3 alone.

Ex: PMT(1.99/12,36,25000)
Result: -715.96

Format a Number

One parameters: number

Ex:NUMBERFORMAT(-2530023420269.123456)
Result: -2,530,023,420,269

Ex: NUMBERFORMAT(25000.123456, {precision:2})
Result: 25,000.12

Format Currency

Format a number to a certain currency. Two parameters: number, settings (optional). If settings option is a string it is treated as a currency name. If it is an object it is used as currency settings.

Ex: NUMBERFORMAT(25000.123456, 'USD')
Result: $25,000.12

Settings can be format, and then override with options.

Ex: NUMBERFORMAT(-25000.123456, 'GBP', { negative: '()', precision: 3, thousand: '' })
Result: £(25000.123)

Format a Percent

Format a number with a certain precision. Two parameters: number, settings ("percent" is a format)

Ex: NUMBERFORMAT(25000.123456, 'percent')
Result: 25,000%

Create a Currency

You may create a currency. The library comes with "USD", "GBP", and "EUR" currency formats and "number" and "percent" numeric formats. Two parameters: key, settings

Ex: ADDFORMAT('Dollars', { before: '', after: ' Dollars', precision: 0, thousand: ',', group: 3, decimal: '.', negative: '-' })
Result: true

Ex: NUMBERFORMAT(25000.123456, 'Dollars')
Result: 25,000 Dollars

REMOVEFORMAT(x)

Remove a Currency
To remove a currency. One parameter: key

Ex: REMOVEFORMAT('Dollars')
Result: true