Interface IStdFinancialModule
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
costVBDoubleValueThe initial cost of the asset.
salvageVBDoubleValueThe value of the asset at the end of its useful life.
lifeVBDoubleValueThe length of the asset's useful life.
periodVBDoubleValueThe period to depreciate the asset for, in the same unit as
life.factorVBVariantValueThe 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
rateVBDoubleValueThe interest rate per period.
nPerVBDoubleValueThe total number of payment periods, in the same unit as
rate.pmtVBDoubleValueThe payment made each period.
pVVBVariantValueThe present value, or lump sum, of the future payments.
0when unspecified.dueVBVariantValue0when payments are due at the end of each period,1when they are due at its beginning.0when 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
rateVBDoubleValueThe interest rate per period.
perVBDoubleValueThe payment period, in the range 1 through
nPer.nPerVBDoubleValueThe total number of payment periods, in the same unit as
rate.pVVBDoubleValueThe present value of the payments.
fVVBVariantValueThe balance wanted after the final payment.
0when unspecified.dueVBVariantValue0when payments are due at the end of each period,1when they are due at its beginning.0when 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
valueArrayVBResizableArrayValueThe cash flows, in the order they occur: at least one payment (negative) and one receipt (positive).
guessVBVariantValueAn estimate of the rate to start the calculation from.
0.1when 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
valueArrayVBResizableArrayValueThe cash flows, in the order they occur: at least one payment (negative) and one receipt (positive).
finance_RateVBDoubleValueThe interest rate paid as the cost of financing.
reinvest_RateVBDoubleValueThe 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
rateVBDoubleValueThe discount rate over one period.
valueArrayVBResizableArrayValueThe 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
rateVBDoubleValueThe interest rate per period.
pmtVBDoubleValueThe payment made each period.
pVVBDoubleValueThe present value of the payments.
fVVBVariantValueThe balance wanted after the final payment.
0when unspecified.dueVBVariantValue0when payments are due at the end of each period,1when they are due at its beginning.0when 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
rateVBDoubleValueThe interest rate per period.
perVBDoubleValueThe payment period, in the range 1 through
nPer.nPerVBDoubleValueThe total number of payment periods, in the same unit as
rate.pVVBDoubleValueThe present value of the payments.
fVVBVariantValueThe balance wanted after the final payment.
0when unspecified.dueVBVariantValue0when payments are due at the end of each period,1when they are due at its beginning.0when 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
rateVBDoubleValueThe interest rate per period.
nPerVBDoubleValueThe total number of payment periods, in the same unit as
rate.pmtVBDoubleValueThe payment made each period.
fVVBVariantValueThe balance wanted after the final payment.
0when unspecified.dueVBVariantValue0when payments are due at the end of each period,1when they are due at its beginning.0when 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
rateVBDoubleValueThe interest rate per period.
nPerVBDoubleValueThe total number of payment periods, in the same unit as
rate.pVVBDoubleValueThe present value, or lump sum, the payments are worth now.
fVVBVariantValueThe balance wanted after the final payment.
0when unspecified.dueVBVariantValue0when payments are due at the end of each period,1when they are due at its beginning.0when 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
nPerVBDoubleValueThe total number of payment periods.
pmtVBDoubleValueThe payment made each period.
pVVBDoubleValueThe present value of the payments.
fVVBVariantValueThe balance wanted after the final payment.
0when unspecified.dueVBVariantValue0when payments are due at the end of each period,1when they are due at its beginning.0when unspecified.guessVBVariantValueAn estimate of the rate to start the calculation from.
0.1when 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
costVBDoubleValueThe initial cost of the asset.
salvageVBDoubleValueThe value of the asset at the end of its useful life.
lifeVBDoubleValueThe 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
costVBDoubleValueThe initial cost of the asset.
salvageVBDoubleValueThe value of the asset at the end of its useful life.
lifeVBDoubleValueThe length of the asset's useful life.
periodVBDoubleValueThe 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.