Table of Contents

Interface IStdFinancialModule

Namespace
RDCore.SDK.Runtime.Abstract.StdLib
Assembly
RDCore.SDK.dll

MS-VBAL 6.1.2.6 Financial Module

[StdLibModule(null)]
public interface IStdFinancialModule

Remarks

Formalizes the public interface of the standard library VBA.Financial module.

Two conventions run through the module. For the annuity functions, "cash paid out (such as deposits to savings) is represented by negative numbers; cash received (such as dividend checks) is represented by positive numbers" — and the cash flows of IRR(VBResizableArrayValue, VBVariantValue?), MIRR(VBResizableArrayValue, VBDoubleValue, VBDoubleValue) and NPV(VBDoubleValue, VBResizableArrayValue) are signed the same way. And an optional argument is declared Variant with no default value, the specification stating the value an omitted one stands for in its own description instead — 0 for a present value and for Due, 0.1 for a Guess, 2 for a Factor, and 0 for a future value, which only PV(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBVariantValue?, VBVariantValue?)'s description leaves unsaid — which is a default a C# signature cannot state either, so an implementation supplies it.

Methods

DDB(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBDoubleValue, VBVariantValue?)

MS-VBAL 6.1.2.6.1.1 DDB Gets the depreciation of an asset for a given period, by the double-declining balance method or another declining rate.

RuntimeSemanticsEvaluationResult<VBDoubleValue> DDB(VBDoubleValue cost, VBDoubleValue salvage, VBDoubleValue life, VBDoubleValue period, VBVariantValue? factor = null)

Parameters

cost VBDoubleValue

The initial cost of the asset.

salvage VBDoubleValue

The value of the asset at the end of its useful life.

life VBDoubleValue

The length of the asset's useful life.

period VBDoubleValue

The period to depreciate the asset for, in the same unit as life.

factor VBVariantValue

The rate the balance declines at. 2 — the double-declining method — when unspecified.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

FV(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBVariantValue?, VBVariantValue?)

MS-VBAL 6.1.2.6.1.2 FV Gets the future value of an annuity of fixed periodic payments at a fixed interest rate.

RuntimeSemanticsEvaluationResult<VBDoubleValue> FV(VBDoubleValue rate, VBDoubleValue nPer, VBDoubleValue pmt, VBVariantValue? pV = null, VBVariantValue? due = null)

Parameters

rate VBDoubleValue

The interest rate per period.

nPer VBDoubleValue

The total number of payment periods, in the same unit as rate.

pmt VBDoubleValue

The payment made each period.

pV VBVariantValue

The present value, or lump sum, of the future payments. 0 when unspecified.

due VBVariantValue

0 when payments are due at the end of each period, 1 when they are due at its beginning. 0 when unspecified.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

Remarks

👉 The specification's own declaration omits Optional from pV and due, where its description of each says what an omitted one means, as the Office reference does — and every other annuity function declares its Due optional. They are optional here.

IPmt(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBDoubleValue, VBVariantValue?, VBVariantValue?)

MS-VBAL 6.1.2.6.1.3 IPmt Gets the interest part of an annuity's payment for a given period.

RuntimeSemanticsEvaluationResult<VBDoubleValue> IPmt(VBDoubleValue rate, VBDoubleValue per, VBDoubleValue nPer, VBDoubleValue pV, VBVariantValue? fV = null, VBVariantValue? due = null)

Parameters

rate VBDoubleValue

The interest rate per period.

per VBDoubleValue

The payment period, in the range 1 through nPer.

nPer VBDoubleValue

The total number of payment periods, in the same unit as rate.

pV VBDoubleValue

The present value of the payments.

fV VBVariantValue

The balance wanted after the final payment. 0 when unspecified.

due VBVariantValue

0 when payments are due at the end of each period, 1 when they are due at its beginning. 0 when unspecified.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

IRR(VBResizableArrayValue, VBVariantValue?)

MS-VBAL 6.1.2.6.1.4 IRR Gets the internal rate of return of a series of periodic cash flows.

RuntimeSemanticsEvaluationResult<VBDoubleValue> IRR(VBResizableArrayValue valueArray, VBVariantValue? guess = null)

Parameters

valueArray VBResizableArrayValue

The cash flows, in the order they occur: at least one payment (negative) and one receipt (positive).

guess VBVariantValue

An estimate of the rate to start the calculation from. 0.1 when unspecified.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

MIRR(VBResizableArrayValue, VBDoubleValue, VBDoubleValue)

MS-VBAL 6.1.2.6.1.5 MIRR Gets the modified internal rate of return of a series of periodic cash flows, whose payments and receipts are financed at different rates.

RuntimeSemanticsEvaluationResult<VBDoubleValue> MIRR(VBResizableArrayValue valueArray, VBDoubleValue finance_Rate, VBDoubleValue reinvest_Rate)

Parameters

valueArray VBResizableArrayValue

The cash flows, in the order they occur: at least one payment (negative) and one receipt (positive).

finance_Rate VBDoubleValue

The interest rate paid as the cost of financing.

reinvest_Rate VBDoubleValue

The interest rate received on gains from reinvesting cash.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

Remarks

👉 The underscores are the specification's own, and a named argument has to spell them: a name matches whatever its case, but not without them.

NPV(VBDoubleValue, VBResizableArrayValue)

MS-VBAL 6.1.2.6.1.7 NPV Gets the net present value of a series of periodic cash flows at a discount rate, one period before the first of them.

RuntimeSemanticsEvaluationResult<VBDoubleValue> NPV(VBDoubleValue rate, VBResizableArrayValue valueArray)

Parameters

rate VBDoubleValue

The discount rate over one period.

valueArray VBResizableArrayValue

The cash flows, in the order they occur.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

NPer(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBVariantValue?, VBVariantValue?)

MS-VBAL 6.1.2.6.1.6 NPer Gets the number of periods of an annuity of fixed periodic payments at a fixed interest rate.

RuntimeSemanticsEvaluationResult<VBDoubleValue> NPer(VBDoubleValue rate, VBDoubleValue pmt, VBDoubleValue pV, VBVariantValue? fV = null, VBVariantValue? due = null)

Parameters

rate VBDoubleValue

The interest rate per period.

pmt VBDoubleValue

The payment made each period.

pV VBDoubleValue

The present value of the payments.

fV VBVariantValue

The balance wanted after the final payment. 0 when unspecified.

due VBVariantValue

0 when payments are due at the end of each period, 1 when they are due at its beginning. 0 when unspecified.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

PPmt(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBDoubleValue, VBVariantValue?, VBVariantValue?)

MS-VBAL 6.1.2.6.1.9 PPmt Gets the principal part of an annuity's payment for a given period.

RuntimeSemanticsEvaluationResult<VBDoubleValue> PPmt(VBDoubleValue rate, VBDoubleValue per, VBDoubleValue nPer, VBDoubleValue pV, VBVariantValue? fV = null, VBVariantValue? due = null)

Parameters

rate VBDoubleValue

The interest rate per period.

per VBDoubleValue

The payment period, in the range 1 through nPer.

nPer VBDoubleValue

The total number of payment periods, in the same unit as rate.

pV VBDoubleValue

The present value of the payments.

fV VBVariantValue

The balance wanted after the final payment. 0 when unspecified.

due VBVariantValue

0 when payments are due at the end of each period, 1 when they are due at its beginning. 0 when unspecified.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

PV(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBVariantValue?, VBVariantValue?)

MS-VBAL 6.1.2.6.1.10 PV Gets the present value of an annuity of fixed periodic payments at a fixed interest rate.

RuntimeSemanticsEvaluationResult<VBDoubleValue> PV(VBDoubleValue rate, VBDoubleValue nPer, VBDoubleValue pmt, VBVariantValue? fV = null, VBVariantValue? due = null)

Parameters

rate VBDoubleValue

The interest rate per period.

nPer VBDoubleValue

The total number of payment periods, in the same unit as rate.

pmt VBDoubleValue

The payment made each period.

fV VBVariantValue

The balance wanted after the final payment. 0 when unspecified.

due VBVariantValue

0 when payments are due at the end of each period, 1 when they are due at its beginning. 0 when unspecified.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

Remarks

👉 The specification's description of fV says nothing of an omitted one, where every other annuity function's says it is 0. It is 0 here too, by analogy with them.

Pmt(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBVariantValue?, VBVariantValue?)

MS-VBAL 6.1.2.6.1.8 Pmt Gets the payment of an annuity of fixed periodic payments at a fixed interest rate.

RuntimeSemanticsEvaluationResult<VBDoubleValue> Pmt(VBDoubleValue rate, VBDoubleValue nPer, VBDoubleValue pV, VBVariantValue? fV = null, VBVariantValue? due = null)

Parameters

rate VBDoubleValue

The interest rate per period.

nPer VBDoubleValue

The total number of payment periods, in the same unit as rate.

pV VBDoubleValue

The present value, or lump sum, the payments are worth now.

fV VBVariantValue

The balance wanted after the final payment. 0 when unspecified.

due VBVariantValue

0 when payments are due at the end of each period, 1 when they are due at its beginning. 0 when unspecified.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

Rate(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBVariantValue?, VBVariantValue?, VBVariantValue?)

MS-VBAL 6.1.2.6.1.11 Rate Gets the interest rate per period of an annuity of fixed periodic payments.

RuntimeSemanticsEvaluationResult<VBDoubleValue> Rate(VBDoubleValue nPer, VBDoubleValue pmt, VBDoubleValue pV, VBVariantValue? fV = null, VBVariantValue? due = null, VBVariantValue? guess = null)

Parameters

nPer VBDoubleValue

The total number of payment periods.

pmt VBDoubleValue

The payment made each period.

pV VBDoubleValue

The present value of the payments.

fV VBVariantValue

The balance wanted after the final payment. 0 when unspecified.

due VBVariantValue

0 when payments are due at the end of each period, 1 when they are due at its beginning. 0 when unspecified.

guess VBVariantValue

An estimate of the rate to start the calculation from. 0.1 when unspecified.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

SLN(VBDoubleValue, VBDoubleValue, VBDoubleValue)

MS-VBAL 6.1.2.6.1.12 SLN Gets the straight-line depreciation of an asset for a single period.

RuntimeSemanticsEvaluationResult<VBDoubleValue> SLN(VBDoubleValue cost, VBDoubleValue salvage, VBDoubleValue life)

Parameters

cost VBDoubleValue

The initial cost of the asset.

salvage VBDoubleValue

The value of the asset at the end of its useful life.

life VBDoubleValue

The length of the asset's useful life.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

SYD(VBDoubleValue, VBDoubleValue, VBDoubleValue, VBDoubleValue)

MS-VBAL 6.1.2.6.1.13 SYD Gets the sum-of-years' digits depreciation of an asset for a given period.

RuntimeSemanticsEvaluationResult<VBDoubleValue> SYD(VBDoubleValue cost, VBDoubleValue salvage, VBDoubleValue life, VBDoubleValue period)

Parameters

cost VBDoubleValue

The initial cost of the asset.

salvage VBDoubleValue

The value of the asset at the end of its useful life.

life VBDoubleValue

The length of the asset's useful life.

period VBDoubleValue

The period to depreciate the asset for, in the same unit as life.

Returns

RuntimeSemanticsEvaluationResult<VBDoubleValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.