# MIRR Function

Returns a Double specifying the modified internal rate of return for a series of periodic cash flows (payments and receipts).

```
Function MIRR( _
ByRef ValueArray() As Double, _
ByVal FinanceRate As Double, _
ByVal ReinvestRate As Double _
) As Double
```

## Parameters

ValueArray

Required. Array of Double specifying cash-flow values. The array must contain at least one negative value (a payment) and one positive value (a receipt).FinanceRate

Required. Double specifying interest rate paid as the cost of financing.ReinvestRate

Required. Double specifying interest rate received on gains from cash reinvestment.

## Exceptions

Exception type |
Error number |
Condition |
---|---|---|

Rank of ValueArray does not equal 1, FinanceRate = -1, or ReinvestRate = -1 |
||

Division by zero has occurred. |

See the "Error number" column if you are upgrading Visual Basic 6.0 applications that use unstructured error handling. (You can compare the error number against the Number Property (Err Object).) However, when possible, you should consider replacing such error control with Structured Exception Handling Overview for Visual Basic.

## Remarks

The modified internal rate of return is the internal rate of return when payments and receipts are financed at different rates. The MIRR function takes into account both the cost of the investment (FinanceRate) and the interest rate received on reinvestment of cash (ReinvestRate).

The FinanceRate and ReinvestRatearguments are percentages expressed as decimal values. For example, 12 percent is expressed as 0.12.

The MIRR function uses the order of values within the array to interpret the order of payments and receipts. Be sure to enter your payment and receipt values in the correct sequence.

## Example

This example uses the MIRR function to return the modified internal rate of return for a series of cash flows contained in the array Values(). LoanAPR represents the financing interest, and InvAPR represents the interest rate received on reinvestment.

```
' Define money format.
Dim MoneyFmt As String = "###,##0.00"
' Define percentage format.
Dim PercentFmt As String = "#0.00"
Dim values(4) As Double
' Business start-up costs.
values(0) = -70000
' Positive cash flows reflecting income for four successive years.
values(1) = 22000
values(2) = 25000
values(3) = 28000
values(4) = 31000
' Use the MIRR function to calculate the internal return rate.
' Set the loan rate.
Dim LoanAPR As Double = 0.1
' Set the reinvestment rate.
Dim InvAPR As Double = 0.12
' Calculate internal rate.
Dim RetRate As Double = MIRR(values, LoanAPR, InvAPR)
' Display internal return rate.
MsgBox("The modified internal rate of return for these cash flows is " & _
Format(Math.Abs(RetRate) * 100, CStr(PercentFmt)) & "%.")
```

## Requirements

**Namespace:**Microsoft.VisualBasic

**Module:**Financial

**Assembly:** Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)